Introduction to LinkedList

LinkedList is one of the linear Data Structure. LinkedList is a collection of multiple nodes and they are connected using pointer (reference) address. Nodes (elements) are stored in a non-contiguous memory location which means different memory locations.

LinkedList is of three types such as Singly-linkedList, Doubly LinkedList, and Circular LinkedList. Here, we only take Singly LinkedList for simplicity.

Each node consists of two parts one is holding data/value and the second part referencing to another node which we also can say next node address.

Sinlgy Linked list image
Singly Linked List

Traversing: Traversing means visit every node in list until reach to NULL or last node. If we traverse the complete list, its time complexity is O(n). The Last node is identified when the node next is NULL and the NULL means that the node doesn’t have any further nodes in the linked list.

Leave a Reply

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