Linked List
Last updated
Last updated
A linked list is a linear data structure that includes a series of connected nodes. Here, each node stores the data and the address of the next node. For example,
You have to start somewhere, so we give the address of the first node a special name called HEAD
. Also, the last node in the linked list can be identified because its next portion points to NULL.
Linked lists can be of multiple types: singly, doubly, and circular linked list. In this article, we will focus on the singly linked list.
NOTE: You might have played the game Treasure Hunt, where each clue includes the information about the next clue. That is how the linked list operates.
Let's see how each node of the linked list is represented. Each node consists:
A data item
An address of another node
Linked lists are used in many applications. Some of them are:
Dynamic memory allocation
Implemented in stack and queue
In undo functionality of softwares
Hash tables, Graphs