Due date:
Late assignments will be penalized 10% per day, and will not be accepted after .
Name, Student Number, Assignment Number, Course Number (T26)
Assignments which are not in an envelope will not be marked
Deposit your envelope in .
Your program must conform to the programming standards. These are described in a separate sheet.
Note that the main program writes out information about how much memory has been allocated by your procedures but not returned to the global pool. These numbers should always be 0: if they are not, you have bugs to fix.
The program handout consists of 4 files: Partial5.c, Partial5a.h, Partial5b.h, and Partial5c.h. The only file you should modify is Partial5.c. The '.h' files each provide a testing procedure for each of the questions. You must remember to properly define the macro QUESTION at the top of Partial5.c to be the appropriate question number. For example:
#define QUESTION 2is the correct definition for answering question 2, and it causes file Partial5b.h to be automatically included, thus providing your program with the appropriate testing function.
split
operation cannot always update the
size
information in a list header in constant time. In
class we discussed a ``lazy evaluation'' approach to updating this
information. Implement that strategy.
move_backward
is_first
sorted_insert
This is a good example of a precondition that normally is too time-consuming for a procedure to test every time it is called. Your implementation should not test this precondition, but should document it.
sorted_insert
procedure must be
implementation-independent - it must do all its list manipulations
using the operations defined in the specification (including the new
ones in question 2); it must not rely on the details of how lists are
implemented.
void sorted_insert (list l, element e) { ... }