September 2001
Beginner
970 pages
23h 20m
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 (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 (Listing 17.5) functions to fit this definition and test the resulting code with the films3.c (Listing 17.4) program.
Suppose list.h (Listing 17.3) uses the following definition of a list:
#define MAXSIZE 100 typedef struct list { Item entries[MAXSIZE]; /* array of items */ int items; ...Read now
Unlock full access