Linked list is a linear collection of Self-Referential class objects, called nodes, connected by reference links. Many people tend to think of it as of dynamically sized array but you need to understand difference between these two data structures.


 


Notice three things about the list:



• The pointer at the end of the list is null.
• Each node's next pointer points to another unique node in the list or to Null, making the list a linear graph.
• The first node of the list is pointed to by a pointer called head.

The most common and the simplest kind of linked list is a singly-linked list. A singly-linked list containing two values: the value of the current node and a link to the next node.




Double-Linked-List



A little more complex type of linked list is a doubly-linked list. In doubly-linked list each node has two links: one points to the previous node, (or a null value if it is the first node); and one points to the next (or a null value if it is the final node)


Double-Linked-List



Both single and double linked list can form a circularly-linked list. In a circularly-linked list, the first and final nodes are linked together. To traverse a circular linked list, you begin at any node and follow the list in either direction until you return to the original node. If instead of pointing to the first node or to null final node points to any other element in the list, the list called list with a loop.


 







Answers and Comments


Saved Stories

Sponsored Categories