Data Structures & Algorithms: Lecture 5: Linked Lists Variants
Data Structures & Algorithms: Lecture 5: Linked Lists Variants
28/10/2020
Today‘s lecture
▪ 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
▪ Linked structures
► Singly Linked Lists
► Doubly Linked Lists
▪ Application example:
► To ensure several processors sharing the same
resource
► USAGE: All processes are put on a circular list
accessible through the pointer current
head
head
head
head
▪ Example application
head
head
head
head