Summary


Single linked list


Double Linked List
The double linked list is a data structure in computer science where a linked data structure that contains a set of continuously linked records known as nodes. each of these known nodes contains 3 fields, a single data field, and 2 address fields. a double linked list has a major difference from its predecessor which is a single linked list in which a single linked list connects each node in one way from the start until its end, while the double linked list has each node connected to both its previous and next nodes which makes two-way movement in between them.


a node of a double linked list.
 
a node of a single linked list.

  1. the linked list address fields contain the address of its previous node and next node
  2. generally, each end of a double linked list contains a terminator that generally consists of a null value.
  3. double linked list allow node traversal in both directions.



Circular Linked List

Sorted insert for circular linked list - GeeksforGeeks

Simply put, a circular linked list happens when a linked list last element points to its first element. this means that this linked list hast no terminator or any null value. and this can happen to both a single linked list and a double linked list. 


Single Circular Linked List
Singly Linked List as Circular Linked List


in a singly circular linked list, the next pointer in the last node points to the first node of that linked list.

Double Circular Linked List
Doubly Linked List as Circular Linked List


in a double circular linked list, the previous pointer of the first node points to the previous pointer of the last node and the next pointer of the last node point to the previous pointer of the first node.






Komentar

Postingan populer dari blog ini

Binary Search Tree

AVL Tree & B-Tree

Summary