CodeSteps

Python, C, C++, C#, PowerShell, Android, Visual C++, Java ...

Data Structures – Understanding Linked Lists

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.

Singly Linked List
Singly Linked List

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.

Doubly Linked List
Doubly Linked List

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.

Circular Linked Lists
Circular Linked Lists

We will discuss more on lists in our coming Articles.

// Malin

Data Structures – Understanding Linked Lists

2 thoughts on “Data Structures – Understanding Linked Lists

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top