Introduction to Linked List

Linked list is a linear data structure used to store data. Each element of linked list is stored in the form of node.  A node is a collection of two fields: data and a pointer. A data part is used to store data and a pointer part is used to store the address of a next node of a linked list.

Unlike arrays, elements of a linked list are not stored in contiguous manner. Each node of a linked list points to the next node of the list to form a complete linked list. The size of the linked list is not fixed like arrays. Usually, the first node of the linked list is referred to as the head of the linked list.

        MAJOR POINTS:

  1. Linked list is a linear data structure.
  2. Each element of a linked list is stored in the form of node.
  3. A node contains two fields: a data field used to store data and a pointer field used to store address of a next node.    
  4. The nodes of a linked list are not stored in contiguous manner.
  5. The size of linked list is of variable length.

Types of Linked list:

Generally, Linked list can be categorised into three types:

  • Singly linked list:  It is a most common type of linked list where each node contains two fields: data field used to store data and pointer field used to store address of next node. The last node of a singly linked list point to the NULL.
  • Doubly linked list: In doubly linked list, the nodes contains three fields : a data fields used to store data and two pointer fields used to store the address of next node of a linked list and previous node of a linked list. The next pointer of last node of a doubly linked list points to the NULL. Similarly, the previous pointer of the first node of a linked list points to the NULL.
  • Circular linked list: Circular linked list is a singly linked list with a little variation. The last node of a circular linked list points to the first node of the linked list or head of the linked list.

Related Posts:

  1. Linked List Vs. Arrays.
  2. Insert a New Node at the beginning of the Linked List.
  3. Insert a New Node at the end of the Linked List.
  4. Insert a New Node at the Middle of the Linked List.
  5. Insert a New Node at the Sorted Linked List.
  6. Reverse a Linked List.
  7. Reverse a Linked List Using Stack.
  8. Printing Linked List in Reverse Order without actually reversing the Linked List.
  9. Swap Adjacent Elements of the Linked List.
  10. Count All Occurrences of a Particular Node in a Linked List.
  11. Bubble Sort on Linked List.
  12. Detect a Loop in a Linked List.
  13. Find the Length of the Loop present in the Linked List.
  14. Detect and Remove Loop from a Linked List.
  15. Segregate Even and Odd Nodes of the Linked List.
  16. Delete Complete Linked List.
  17. Delete Nth Node of the Linked List.
  18. Delete without head pointer of the Linked List.
  19. Delete All Occurrences of particular node of the Linked List.
  20. Delete Alternate Nodes of the Linked List.

You may also like...

Leave a Reply

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