Table of Contents
|
(Spring 1996) Data Structures and Algorithms |
| Week | Topic |
|---|---|
| 1 (29 Jan) | Introduction. Web page resources. Ch1: Preliminaries (Software development overview, |
| 2 (5 Feb) | Ch 2: Private vs. Limited private, Encapsulation (generic, polymorphic, child units) |
| 3 (12 Feb) | Ch 2: Tagged Types Test on Wednesday (Chs 1: Static types, Access types, linear linking.) |
| 4 (19 Feb) | Ch 2: Ada.Finalization, PART I: Linear Structures |
| 5 (26 Feb) | Ch 3: Stacks, Ch. 4 Queues, Intro to .Advanced child units |
| 6 (4 Mar) | .Advanced and .Iterators child units |
| 7 (11 Mar) | Ch 5: Lists, (Access types, Stacks, and Queues, including .Advanced and .Iterators child units) |
| 8 (18 Mar) | Ch 5 (Con'd), Ch 6: Binary Trees, |
| 9 (25 Mar) | Chs 6 |
| 10 (1 Apr) | |
| 11 (8 Apr) | - Ch (Con'd) |
| 12 (15 Apr) | Ch 6 (tree traversals), Ch 7 AVL, complete trees, heaps |
| 13 (22 Apr) | |
| 14 (29 Apr) | Chs 8,9,10: Digraphs, Sets, and Strings |
| 15 (6 May) | Chs. 11-12: Sorting and Searching |
| 16 (13 May) |
Goal: The purpose of this laboratory assignment is to acquaint you with surfing the web and for you to take a look at the Lovelace tutorial that was written by David Wheeler of IDA. As the course progresses and you find yourself having difficulty with certain aspects of Ada, make use of this tutorial to gain insight into the various features of the language.
The Assignment: Use Netscape Navigator, either from the Suns, or from any other scource (there are some PCs that are on the net that have Netscape on them). Access the URL, http://academic.uofs.edu/faculty/beidler/. From that web page you can directly access the Lovelace tutorial. Spend some time browsing the tutorial. Complete at least one of the tutorial's Lessons.
Due Date: You must complete this laboratory assignment by 12 midnight Sunday February 4, 1996. NO EXCEPTIONS, NO EXCUSES. If you wait until the last minute and the system is down, the grade is "0".
What to Submit: In class you were assignned a lesson number. From the tutorial's Table of Contents click on your assigned lesson number and bring that lesson up. Pull down the File menu and use the Save option to same the page your viewing in a file. Simply email that file containing that page to beidler@cs.uofs.edu
Goal: Learn about the basics of working with pointer (access types)
Assignment:Do the following:
Due Date: You must complete this laboratory assignment by 12 midnight Sunday February 11, 1996. NO EXCEPTIONS, NO EXCUSES. If you wait until the last minute and the system is down, the grade is "0".
What to Submit: Send me two email messages:
Goal: Gain some experience with type extension and dynamic dispatch using tagged types in Ada.
Assignment:
Point.all'tag = rectangle'tagtests to see if the record point.all is a rectangle. You will have to construct a compound boolean expression to test to see if the record being accessed by Point is a rectangle or a square, then execute a statement sequence within the if, like
if Is_Square (Point.all) then
text_io.Put ("Is a square");
else
text_io.Put ("Is not a square");
end if;
text_io.new_line;
Due Date: You must complete this laboratory assignment by 12 midnight Sunday February 18, 1996. . If you wait until the last minute and the system is down, the grade is "0".
What to Submit: Send me two email messages:
Goal: Write an Adjust procedure for a controlled type
Resources: You will need four file, a data file, the specifications and body for a polynomial package, and a procedure that uses the polynomial package:
Description: First of all compile the polynomial package, then compile, link, and run use_polynomial. When you run use polynomial note how the first pair of outputs for P and Q are different, after
Q := P,the program adds a new term to P then prints both. Note that P and Q are the same. This is because they are sharing the same linked representation. This is because the Adjust procedure does not make a duplicate of the linked structure. Your task is to write the code for Adjust. Remove the "--" comment from the assignment statement at the beginning of Adjust, remove the null statement in Adjust, then write the procedure. You will know that you have written it correctly when the last output of Q does not contain the
5.00000E00 x^2term. GOOD LUCK.
Due Date: You must complete this laboratory assignment by 12 midnight Sunday February 25, 1996. . If you wait until the last minute and the system is down, the grade is "0".
What to Submit: Cut and paste your Adjust Procedure into an email message and send it to me.
Due Date: You must complete this laboratory assignment by 12 midnight Sunday March 3, 1996. . If you wait until the last minute and the system is down, the grade is "0".
What to Submit: Cut and Paste your Finalize procedure into an email message and send it to me.
To perform this lab you will be using the polymorphic stack package, which is already available on the Suns, or you can ftp the complete set of polymorphic data structures to your machine from ftp.cs.uofs.edu from the pub/Ada subdirectory. To perform this lab you need three resources,
The poly_Paren procedure reads a string and checks for correct matching of parentheses types, { to }, [ to ], and ( to ). Other symbols may appear in the string. This procedure reads the string and checks for the match. However, every time it sees an 'x' it calls the iterator to print the contents of the stack. To illustrate, here is a sample dialog with the program:
Enter any string - checks for proper parenthesis matching
([({()})((aa))]) would be accepted, but (())) would not
Enter Paren string: [[[x(((x[x]))x)]x]x]x
Stack top-to-bottom = [[[
Stack top-to-bottom = ((([[[
Stack top-to-bottom = [((([[[
Stack top-to-bottom = ([[[
Stack top-to-bottom = [[
Stack top-to-bottom = [
Stack top-to-bottom =
ACCEPTED
I'd suggest you do the following:
Due Date: You must complete this laboratory assignment by 12 midnight Sunday March 10, 1996. . If you wait until the last minute and the system is down, the grade is "0".
What to Submit: Email to me poly_paren_pak.adb
Description:In this lab you will complete three subprograms in bin_search_tree.adb as follows:
Due Date: You must complete this laboratory assignment by 12 midnight Sunday April 21, 1996. . If you wait until the last minute and the system is down, the grade is "0".
What to Submit: bin_search_tree.adb
Assignment:Complete the AVL restructuring in avl_tree.adb.
Resources: Use the avl_support package and random.dat file from the previous Lab. assignment. Bring avl_tree.adb into your account. It contains the same "--<<" tags to the locations you must modify, as the previous Lab
Description: Do the following:
What to submit Email the avl_tree procedure. Also include in your email message the values returned by the longest and shortest path procedures.
Due Date: You must complete this laboratory assignment by 12 midnight Sunday April 27, 1996. . If you wait until the last minute and the system is down, the grade is "0".
What to Submit: Cut and Paste your Finalize procedure into an email message and send it to me.
You will be participating in a doctoral research experiment at George Washington University. Details of you participation will be placed here shortly.
Due Date: Probably midnight Sunday May 5, 1996
Goal:
Assignment:Complete the code in link_merge. The program contains a procedure to create two linked structures, each structure contains twenty random numbers. The software system also contains a procedure that either prints the symbol "<>" when the list is null, or prints the numbers in the records in the order in which they appear in the linear structure, from first to last. Your task it to complete the software system so that the output produced by the five calls to the printing procedure demonstrate that the original sets in the two lists are ordered, then after the call to the merge procedure that you complete, the three remaining calls demonstrate that the two original lists had been emptied and that the third list contains the complete set of values properly merged.
To obtain the resources you need to complete this task,
Due Date: You must complete this laboratory assignment by midnight Wednesday February 21, 1996. NO EXCEPTIONS, NO EXCUSES. If you wait until the last minute and the system is down, the grade is "0".
What to Submit: Note how the initial source code contains in-line comments. Place similar and meaningful comments along with your code. Send me two email messages:
I compute grades by using a weighted average. Specifically, each item is given a maximum possible grade, Mi , and a weighht, Wi. Given your grade for an assignment or test, Gi, the effective grade for that assignment is Wi*Gi/Mi. Your final grade is computed as
This computation produces a value in a standardized range. I reserve the right to determine the correspondence between these values and letter grades.
The Border Crossing Problem is described in Section 8.6 of the notes. Your task is to carry out the solution described in that section. To get you started, a piece of code to read the border information has been supplied, as well as a data set thaht contains the border information for a map of the forty eight contiguous United States. These files are:
Compile. link and run map.adb before you get started. You may want to take a look at how it works. Impliment the solution to the border crossing problem as described in Section 8.6. Your program should accept two two-letter string abbreviations for the names of states, solve the problem, and print a solution path.
DUE DATE: By noon on Friday May 17, 1996, email me a copy of your program.
Exercise 6 in Section 11.4 of the notes describe the results when five sets of data are run through three sort procedures. Write a paper describing your analysis of the five data sets and the three sort procedures that were used. One data set is the numbers in order, one is the numbers in reverse order, one are all the same, one random, and one where each number is almost where it belongs. Your task is to try and decide which set is which, and what are the three sort techniques that were used.
Write your analysis of the data sets. You may assume that one sort is an O(n^2) sort, and one is an O(n log n) sort. A good start would be to draw a line graph of the data as a starting point.
Your analysis must be word processed, double spaced. Please place your name in the upper left corner of each page and "Cmps 240" in the upper right corner. Include in your submission your line graphs.
DUE by noon Friday, May 17th