Requirements for CS330 Fall 2001 Project 3

This series of experiments must be completed on your own. Hand in what you have got on the deadline. The quiz will ask at least one question about the work you did in this project. The experiments are based on assigned reading and work done in class October 16th thru to Nov 8th. Start the first step as soon as you can. Hint: Think before you code.

3A. Lists. Chapter 9 Exercise 4: asks for a member function to return the nth item of list. Write one based on Budd's implementation. Aim for the simplest possible (however slow) way of doing thins. Test and debug your code (this means getting most of Budd's list and adding a new operation/member function to it). Do not optimize it! Hand in the code for your member function only.

3B. Stacks and Queues Three or four CS202 labs use their own Stack and Queue:

Your task is to remove them and use the STL in one(1) of the programs below: in lab04

OR in lab07.html

Make as few changes as you can in the program you choose. Keep them in the main program. Highlight the changes and hand in the main program.

3C. Deques Chapter 11, exercise 3 page 262. Recode deque::pop_front and deque::pop_back. Test and debug your code. Hand in the debugged code for the member functions only.

3D. Trees Implement the Animal Guessing Game in section 13.2.3 pages 304 thru to 307. This means you also have to implement part of classnode in chapter 12 (Figure 12.7 etc) without being distracted by the code in node needed for class set.

3E. Sets

is a copy of a part of the draft C++ standard (real standards are not free, drafts

are). There is too much information on this page (like the real standard) so search for

23.3.3 Template class set [lib.set]

Table 7--Associative container requirements

to see what the real <set> can do. There is more in the <algorithm> library

(For example: in the browser "Edit" -> "find_in_page" and inpout "set_difference" )

Use the STL <set> and <algorithm> to implement and test a simple spell checker like the one in section 12.4.1 pages 272-273 of Budd. Do this in the simplest way you can think of. Make it work. Do not optimize.

Hand in Your code. Grading: Each step (A, B, C, D, E) will be given the same weighting (5 points). The grade depends on writing simple obvious code and using comments to explain what is not obvious. Comments must explain the purpose of each classes and function, any errors, any clever ideas. Include any invariants etc that might help convince the reader that your code works.