Lists are popular, commonly used, and very useful data structures; directly or indirectly used in most the Applications.
Lists are sequences of structures where data is placed in individual blocks. Each block (we call it, a Node or an Element) contains a data part and an address part which points to another block to form the list. Hence we call lists, linked lists. We will have different types of lists, depending on the arrangement of these blocks or Nodes.
Let’s brief about different types of lists, commonly we use.
Singly linked lists
When a node in a list points to its next node and so on, to form a complete list, we call the list a Singly Linked List. In Singly Linked Lists, the last node does not point to any other Node. The pictorial representation of the singly linked list is below.
To navigate within the complete list, we need to start from the first Node and then move forward direction to navigate to the next Node and so on to complete the navigation within the list. The forward direction is only allowed to navigate within the list in a singly linked list.
Doubly linked lists
Doubly Linked List has Nodes connected to next and previous Nodes. First Node does not have its previous Node and similarly, the last Node does not have its next Node.
Forward and backward directions are allowed to navigate within the list.
Circular linked lists
The last Node in the linear or doubly linked list is connected to the first node to form the circular linear or doubly linked list. In this, there is no last Node, as all Nodes are linked.
We will discuss more on lists in our coming Articles.
// Malin
2 thoughts on “Data Structures – Understanding Linked Lists”