Grokking Data Structures & Algorithms for Coding Interviews
Ask Author
Back to course home

0% completed

Vote For New Content
Types of LinkedList
Table of Contents

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible

Linked lists come in different variations based on how nodes are connected and how traversal is performed. The three main types of linked lists are:

  1. Singly Linked List
  2. Doubly Linked List
  3. Circular Linked List

Each type has different properties and is used in different scenarios.

1. Singly Linked List

A Singly Linked List (SLL) is the simplest form of a linked list.

  • Each node contains data and a pointer to the next node.
  • Traversal is one-directional, meaning we can only move forward through the list.
  • The last node’s pointer is NULL, indicating the end of the list.
Image

Characteristics

✅ Simple and easy to implement.
✅ Uses less memory than doubly linked lists.
✅ Efficient for sequential traversal and insertions at the beginning.
Backward traversal is not possible.
❌ Deletion of a node requires modifying previous node’s pointer.

Node Structure for Singly Linked List

Python3
Python3
. . . .

2. Doubly Linked List

A Doubly Linked List (DLL) allows two-way traversal.

  • Each node contains data, a pointer to the next node, and a pointer to the previous node.
  • This allows movement both forward and backward.
Image

Characteristics

✅ Allows both forward and backward traversal.
✅ More flexible than singly linked lists.
Efficient deletion since we have a reference to the previous node.
❌ Requires extra memory due to the additional pointer.
❌ More complex to implement than singly linked lists.

Node Structure for Doubly Linked List

Python3
Python3
. . . .

3. Circular Linked List

A Circular Linked List (CLL) is a variation where:

  • The last node points back to the first node, forming a loop.
  • Can be singly or doubly circular.
Image

Characteristics

✅ No NULL pointers; last node connects to first.
✅ More efficient in circular applications (e.g., Round Robin scheduling).
✅ Useful in buffered data structures like audio/video streaming.
❌ More complex traversal due to looping nature.

Comparison of Linked List Types

FeatureSingly Linked ListDoubly Linked ListCircular Linked List
DirectionOne-wayTwo-wayCan be one-way or two-way
Memory UsageLowerHigher (extra pointer)Similar to singly
TraversalForward onlyForward & backwardLoops continuously
UsageSimple listsComplex operationsCircular applications

Next, we will implement linked lists with insertion and deletion operations!

.....

.....

.....

Like the course? Get enrolled and start learning!

Table of Contents

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible