October 2004
Intermediate to advanced
336 pages
6h 27m
English
This function inserts an entry into an ordered, singly linked list. Each entry in the list is a structure that contains an integer key value, a next pointer, and some other data. The structure is defined as follows:
typedef struct _entry {
int key;
int data;
char name[20];
struct _entry * next;
} entry, * entry_ptr;
The head of the linked list is saved in a pointer that is stored outside the list itself. Within the list, the next pointer in each entry points to the next element in the list. The end of the linked list is denoted by the next pointer of the last entry being set to NULL.
The order of the list is determined ...
Read now
Unlock full access