Chapter 16: Linked lists

Society for Industrial and Applied Mathematics eBooks · 2014

16.1 ▪ Linked lists A linked list is a data structure consisting of objects called nodes, where each node consists of a pointer to user-supplied data and a pointer to the next node, as shown in this schematic diagram: The last node has no successor; therefore its next-node pointer is NULL. Access to the linked list is provided through a pointer to the first node—it's marked list in the diagram above, but you may name it anything you wish. Beginning with list, wemay hop from a node to the next following the next-node pointers and thus traverse the entire list. When we arrive at NULL, we know we're at the end. The C idiom for traversing a linked list is where p has the type of a “pointer to node”.

Read the paper · More papers on PaperTik