Linked List:
Linked List is a data structure used for sorting collection of a data and has the following properties:
§ Successive elements are not connected by pointers
§ Can grow or shrink size during execution of the program
§ It does not waste memory
§ 1st node is considered as head
§ Last node is considered as the tail
Main Linked List operations:
Insert: Inserts elements in the list.
Delete: Delete an element from the list.
Why Linked List??
There are so many data structures which can do the same thing. The important thing is understanding the difference between linked list and arrays. Both linked list and arrays are used to store collection data.
Arrays have a constant access time by using index and size is fixed.
Liked list access time is more but can be growable or resizable.
Linked List types:
A. Singly Linked List
B. Doubly Linked List
C. Circular Linked List
A. Singly Linked List: Generally linked list means singly linked list. It has a number of node a pointer to next node.
B. Doubly Linked List: It is also called as two way linked list. It is called so because it can navigate in both the directions.
C. Circular Linked List: Single and Doubly linked list have ends but circular linked list does not have ends. While traversing a circular linked list we have to careful otherwise we will traverse infinitely.