What are the different types of Linked Lists?
A linked list is a linear data structure where each element is a separate object. Technically speaking, a linked list is a linear collection of data elements, called nodes. In this list, each node points to another node by means of a pointer, and together form a sequence.
There are three types of Linked Lists:
- Singly Linked List: Every node stores, addresses or references to the next node in list and the last node has next address or referenced as NULL. For example: 1->2->3->4->NULL
- Doubly Linked List: There are two references associated with each node. One of the references points to the next node and one to the previous node. For example: NULL<-1<->2<->3->NULL
- Circular Linked List: All nodes are connected to form a circle. There is no NULL at the end. The pointer of last node points back to the first. A circular linked list can be a singly circular linked list or doubly circular linked list. For example: 1->2->3->1.