September 1998
Intermediate to advanced
848 pages
20h 13m
English
Many programming problems, such as creating a list or a queue, can be handled with a linked list—by which we mean a linked sequence of dynamically allocated structures—or with an array. Each form has its strengths and weaknesses, so the choice of which to use depends on the particular requirements of a problem. Table 17.1 summarizes the qualities of linked lists and arrays.
| Data Form | Pros | Cons |
|---|---|---|
| Array | Directly supported by C time Provides random access | Size determined at compile time |
| Inserting and deleting elements is time-consuming | ||
| Linked List | Size determined during runtime | No random access |
| Inserting and deleting elements is quick | User must provide programming support |
Take a ...
Read now
Unlock full access