March 2019
Intermediate to advanced
336 pages
9h 9m
English
In a doubly linked list, all nodes have a pointer to the node they are connected to, on either side of them, in the list. This means that each node is connected to two nodes, and we can traverse forward through to the next node or backward through to the previous node. Doubly linked lists allow insertion, deletion and, obviously, traversing operations. The node class definition is presented in the following code example:
// Node classtype Node struct { property int nextNode *Node previousNode *Node}
The following sections explain doubly linked list methods, such as the NodeBetweenValues, AddToHead, AddAfter, AddToEnd, and main methods.
Read now
Unlock full access