This website is preserved for historical and scholarly reference and is no longer actively maintained.

Assignment #2

Due Wednesday, February 10 at 8:00 a.m..

This individual programming assignment will be accepted up to four class days after the program was due. There will be penalty points deducted as follows.



You may use the following code to begin your assignment. The file called user.cpp contains code that generates random numbers and stores them in a file. The file user.cpp also contains comments indicating where you are to add code.

Compile your program using "CC user.cpp". The above files have all been altered to run on CC. On some platforms you may be able to compile using "g++ user.cpp", but warning messages will be generated. (Remember to use "rm -r Templates.DB" between compilations when you are using CC.)

***** ASSIGNMENT *****

Implement the radix sort for linked lists as described in class.

Use pseudocode comments to describe your algorithm for the radix sort and then implement the sort. The file user.cpp contains a comment showing you where to place the pseudocode algorithm.

Do not change the code supplied to you -- only add to it.

The file "user.cpp" asks the user to supply the maximum integer value to be stored in the list and the length of the list. After the user inputs the value for maximum-integer-value, you are ready to compute k, the maximum number of digits. (For example, if the maximum integer value is 999 the list entries will be in the range 1..999 and k will be 3.) It is suggested that you begin working on this program by performing this calculation.

This assignment is not easy. Expect to encounter problems and begin work on the assignment now. Work in a top-down manner, adding one feature at a time and compiling and executing after each addition.

Using the handin command, turn in your user program, It is not necessary to turn in the List.h, List.cpp, ListNode.h and ListItr.h files. It is assumed that you have made no changes to these. Programs that do not compile will receive very little credit.

Return to Eleanor Hare's home page.

Return to Department of Computer Science Home page.