September 1998
Intermediate to advanced
848 pages
20h 13m
English
Modify Listing 17.2 so that it displays the movie list both in the original order and in reverse order. One approach is to modify the linked-list definition so that the list can be traversed in both directions. Another approach is to use recursion.
Suppose list.h (refer to Listing 17.3) uses the following definition of a list:
typedef struct list
{
Node * head; /* points to head of list */
Node * end; /* points to end of list */
} List;
Rewrite the list.c (refer to Listing 17.5) functions to fit this definition and test the resulting code with the films3.c (refer to Listing 17.4) program.
Suppose list.h (refer to Listing 17.3) uses the following definition of a list:
#define MAXSIZE 100 typedef struct list { Item entries[MAXSIZE]; ...Read now
Unlock full access