Linked List

Definition

A Linked List is a linear collection of data element(where linearity is achieved by pointers in node) with following properties:.
  1. Each element of Linked list is called Node
  2. There is a pointer called start. Which contains address of first Node
  3. Each Node has atleast two part. 1st is data part another is pointer part. Data part contains actual data. and pointer part contains address of next Node.
  4. Pointer of Last Node of Linked List contains null.

Types of Linked List

  1. Simple Linked List
  2. Header Linked List
  3. Circular Linked List
  4. Two way Linked List
  5. Hybrid Linked List

Simple Linked List

A simple Linked List is a collection of data elements called Nodes with following properties:
  1. Start Pointer will contain address of 1st node.
  2. Pointer of node contains address of next node.
  3. Pointer field of last node contains null value.
Simple Linked List

Header Linked List

A Header Linked List is a collection of data elements called Nodes with following properties:
  1. 1st node will be header node.(Header node is a special type of node which contains information about the list. (like: No of nodes, size of nodes etc)
  2. Start pointer will contains address of header node.
  3. [remaining properties are same as Simple linked list]
Header Linked List

Circular Linked List

A circular Linked List is a collection of data elements called Nodes with following properties:
  1. Start Pointer contains address of 1st Node.
  2. Pointer of node contains address of next node.
  3. Pointer field of last node contains address of First node.
Circular Linked List

Two Way Linked List

A Two way Linked List is a collection of data elements called nodes with following properties:
  1. There are two pointers Start and End. Start contains address of First Node, End contains address of Last Node.
  2. Each Node has two pointer fields and 1 data field. 1 pointer field contains address of previous node is called Prev. Another pointer field contains address of next node is called Next.
  3. Prev of 1st node and Next of Last node contains Null.
Two Way Linked List

Hybrid Linked List

A hybrid linked list is a special type of linked list, it is actually combination of two or more type of linked lists.
For Example
It can be Header Circular Linked list or Header Two way linked list or it can Circular Two way linked list

No comments:

Post a Comment