/* related posts with thumb nails */

Linked lists, its advantages & Types of Linked lists:

Linked list is a type of data structure that holds set of nodes linked to each other. Evrey node consists of information parts and reference parts. Linked list allows many operations like insertion, deletion, searching etc. on it.

Advantages:

§ In, Linked lists there will not be any memory wastage or shortage.

§ To insert an element in the linked list, we need not traverse throughout the list.

§ To delete an element in the linked list, we need not traverse throughout the list.

§ Predetermining of number of data elements is not necessary.

Disadvantages:

§ No direct access to a particular element in the list.

Linked lists are mainly of 4 types:

1) Single linear linked list:

In a single linear linked list, every node consists of two parts: information and reference parts. Reference part holds the reference of the next node. It allows one-way and linear traversal in the list. End of the list it points to NULL.



2) Single circular linked list:

In a single circular linked list, every node consists of two parts: information and reference parts. Reference part holds the reference of the next node. It allows one-way and circular traversal in the list. There is no end-node in a list, because the last node is linked to the first node.




3) Double linear linked list:

In a double linear linked list, every node consists of three parts: information and two reference parts. First reference part holds the reference of the previous node and the other holds the reference of the next node. It allows two-way and linear traversal in the list.



4) Double circular linked list:

In a double circular linked list, every node consists of three parts: information and two reference parts. First reference part holds the reference of the previous node and the other holds the reference of the next node. It allows two-way and circular traversal in the list.


null

n2

null

info

n2

n3

n1

n1 n2 n3


Related Topics:

0 comments:

Post a Comment