Wednesday, 18 October 2017

What are the types of Linked list ?


Each element of Linked list have 2 items : Data and Pointer to next element

SINGLY L.L.
Every node have pointer of next node. Last node has pointer = NULL
1->2->3->4->NULL

DOUBLY L.L.
Every node have 2 pointers : for next and previous node
NULL<-1<->2<->3->NULL

CIRCULAR L.L.
It can be singly or doubly L.L. where all elements are connected to form a circle.
The next pointer of last node points to first node
1->2->3->1

 

No comments:

Post a Comment

Note: only a member of this blog may post a comment.