|
|
Take quiz & check grades |
Programming assignment #1Due date: Sunday, October 10th, by midnight. Brief description:In this assignment you are to write a program that reads records from a disk file, insert the records in a Heap ADT and, after all the records are inserted, remove each one of them from the Heap and print as you remove. Hint #1: I suggest you first implement a "fake" heap ADT where the records are sequentially inserted / removed in an array. After this is working and you have a good understanding of the heap structure, modify the ADT to work with a real heap. Detailed description:Records in the disk file consist of a name (char [20]) and a rank (float). All records are fixed lenght and unformatted. If you are not used to reading unformatted files in binary form, check the instructions. You do not know in advance how many records are there. For array dimensioning purposes, you may assume that no more than 50 records will be present. Both your main program and your ADT should be, as much as possible, independent from the record format (at least at the source code level).
The sample program "testfile.c" illustrates how you can generate a test file. This program also illustrates how you can make your main program independent of the record structure. Notice that only the main program is provided in this example. |