(http://www.cs.fiu.edu/~weiss/ada.html)

This page
contains links to supplements that I have developed
to update my data structures textbook to use Ada95.
The text was published in 1993 by
Benjamin/Cummings,
ISBN 0-8053-9055-3.
Professors who are using the text
can obtain a solutions manual
by contacting the publisher.
This work was supported by the *Defense Information Systems Agency*.

- Errata list. This is a bit out of date.
- All of the reports below can be accessed in compressed-tar format. Click here for latex source or here for postscript.
- A short description of what is available. Click here for the postscript version or here for the LaTeX version. (3 pages)
- For instructors, a list of twenty-five lectures with readings and a brief overview of material to cover. Click here for the postscript version or here for the LaTeX version. (6 pages)
- For instructors, a collection of approximately 140 multiple choice questions with answers. Click here for the postscript version or here for the LaTeX version. (28 pages)
- For instructors, a collection of sixteen assignments that I have recently used. Click here for the postscript version or here for the LaTeX version. (17 pages)
- This handout provides a brief overview of the Ada95 compiler
*gnat*running under SunOS. It includes instructions for compiling, linking, and running, as well as a brief summary of the basic differences between Ada83 and Ada95 that are most useful in a data structures course. Click here for the postscript version or here for the LaTeX version. (5 pages) - This handout describes how to access command line arguments in an Ada95 program. Click here for the postscript version or here for the LaTeX version. (2 pages)
- This handout describes the basics of using inheritance under Ada95.
An example that illustrates
*dynamic binding*is provided. Basic knowledge of the language-independent concept of inheritance is assumed; the goal is to illustrate Ada95 syntax. Click here for the postscipt version or here for the LaTeX version. (8 pages) - This handout illustrates how objects are initialized and finalized automatically in Ada95. This is the Ada95 equivalent of the C++ constructor and destructor. Click here for the postscript version or here for the LaTeX version. (11 pages)
- This handout discusses some of the changes
in the on-line code and lists, on a chapter-by-chapter basis,
all compilation units.
The new code includes some additional data structures:
top-down splay trees, top-down red black trees, AA-trees,
and pairing heaps, making the Ada95 supplement in agreement
with the second editions of the text.
Click here for the postscript version or
here for the LaTeX version.
(7 pages)
## Other Home Pages of Interest

- The SIGAda home page has links to every other home page you could possibly need.
- Tim Downey's Ada page has links to get Ada compilers.
- Mike Feldman's list of Ada-Oriented Textbooks.

## Source Code

**NOTE: RECENT COMPILERS REJECT SOME OF THE CODE AND REQUIRE THAT GENERICS BE INSTANTIATED AT LIBRARY LEVEL. THIS MEANS THAT YOU HAVE TO MOVE THE INSTANTIATIONS TO AN OUTER SCOPE.**Complete Ada95 code is available. Click here for the code in compressed tar format.

Here is a listing of source code on a chapter-by-chapter basis. This is in a format suitable for printing out. Click on the chapter of interest: 1 2 3 4 5 6 7 8 10 12

Here is each file.

**fig1_2.adb**: a simple recursive routine with a test program**fig1_3.adb**: an example of infinite recursion**fig1_4.adb**: recursive routine to print numbers, with a test program**fig1_5.adb**: program that counts the number of lines in a file**complex_numbers.ads**: package specification for complex numbers**complex_numbers.adb**: package implementation for complex numbers**complex_numbers_test.adb**: test program for complex numbers**error_pack.ads**: package specification for error routines**error_pack.adb**: package implementation for error routines**fig2_5.adb**: Cubic maximum subsequence sum algorithm**fig2_6.adb**: Quadratic maximum subsequence sum algorithm**fig2_7.adb**:*O*(*n*log*n*) maximum subsequence sum algorithm**fig2_8.adb**: Linear maximum subsequence sum algorithm**fig2_9.adb**: Test program for binary search**binary_search.ads**: Specification of generic function Binary_Search**binary_search.adb**: Implementation of generic function Binary_Search**fig2_10.adb**: Euclid's algorithm, with a test program**fig2_11.adb**: Recursive exponentiation algorithm, with a test program**linked_lists.ads**: Package specification for linked list**linked_lists.adb**: Package implementation for linked list**linked_lists_test.adb**: Test program for linked list package**polynomials.ads**: Package specification for polynomial**polynomials.adb**: Package implementation for polynomial**polynomials_test.adb**: Test program for polynomials**cursor_lists.ads**: Package specification for cursor linked list**cursor_lists.adb**: Package implementation for cursor linked list**stack_array.ads**: Package specification for stack: array version**stack_array.adb**: Package implementation for stack: array version**stack_list.ads**: Package specification for stack: list version**stack_list.adb**: Package implementation for stack: list version**stack_test.adb**: Test program for stacks**queue_array.ads**: Package specification for queue: array version**queue_array.adb**: Package implementation for queue: array version**queue_test.adb**: Test program for queues**search_tree_package.ads**: Package specification for binary search tree**search_tree_package.adb**: Package implementation for binary search tree**search_tree_package_test.adb**: Test program for binary search tree**search_avl.ads**: Package specification for AVL tree**search_avl.adb**: Package implementation for AVL tree**search_avl_test.adb**: Test program for AVL trees**open_hash_table.ads**: Package specification for separate chaining**open_hash_table.adb**: Package implementation for separate chaining**open_hash_table_test.adb**: Test program for separate chaining**closed_hash_table.ads**: Package specification for quadratic probing hash table**closed_hash_table.adb**: Package implementation for quadratic probing hash table**closed_hash_table_test.adb**: Test program for quadratic probing hash tables**binary_heap.ads**: Package specification for binary heap**binary_heap.adb**: Package implementation for binary heap**leftist_heap.ads**: Package specification for leftist heap**leftist_heap.adb**: Package implementation for leftist heap**priority_queue_test.adb**: Test program for priority queues**sorters.ads**: Package specification for a collection of sorting and selection routines**sorters.adb**: Package implementation for a collection of sorting and selection routines**sort.adb**: A test program for the Sorters package**disjoint_sets.ads**: Package specification for disjoint sets**disjoint_sets.adb**: Package implementation for disjoint sets**disjoint_sets_test.adb**: A test program for disjoint sets**fig10_38.adb**: Simple matrix multiplication algorithm with a test program**fig10_40.adb**: Algorithms to compute Fibonacci numbers**fig10_43.adb**: Inefficient recursive algorithm (see text)**fig10_45.adb**: Better algorithm to replace fig10_43.adb (see text)**fig10_53.adb**: All-pairs algorithm, with a test program**random_numbers.ads**: Package specification for uniform random numbers**random_numbers.adb**: Package implementation for uniform random numbers**random_numbers_test.adb**: Test program for random number package**fig10_62.adb**: Randomized primality testing algorithm, with a test program**tic_tac_alpha.adb**: Tic-tac-toe with alpha beta pruning, with a marginal test program**splay_tree_package.ads**: Package specification for top-down splay tree**splay_tree_package.adb**: Package implementation for top-down splay tree**splay_test.adb**: Test program for splay trees**red_black_tree_package.ads**: Package specification for top-down red black tree**red_black_tree_package.adb**: Package implementation for top-down red black tree**red_black_test.adb**: Test program for red black trees**aa_tree_package.ads**: Package specification for AA-tree**aa_tree_package.adb**: Package implementation for AA-tree**aa_test.adb**: Test program for AA-trees**pairing_heap.ads**: Package specification for pairing heap