Doubly Linked Lists
Doubly Linked Lists
17/10/2016
Recap
Linked structures
Singly Linked Lists
struct ListNode {
float value;
struct ListNode *next;
};
Linked structures
Singly Linked Lists
Doubly Linked Lists
head 2 9 7 NULL
Problem:
Cannot get backwards or to the beginning since no
information related to previous node is available
Need a loop
while (nodePtr->next) // Find the last node in the list
nodePtr = nodePtr->next;
Doubly-linked list
Each node has a pointer to its successor and its
predecessor
Faster insert/delete, but more space
Circular list
The last node points back to the head
Sorted list
Items stored in sorted order
Skip list
Skip certain nodes to avoid sequential processing
Self Organizing list
Dynamically organizes the list in a certain manner
27
Doubly Linked List