Tuesday, 31 January 2017

Types of Linked List

Linked List :
A linked list is a data structures, which are connected together via links.
Definition :
Linked List is a sequence of links which contains items (data). Each link contains a connection to another link. Each record of a linked list is often called an node. The field of each node that contains the address(pointer of next link) of the next node is usually called the 'next link' or 'next pointer'. 
Example:
struct node {
  int data;
  struct node *next;
}

Here struct node is structure where data is node and next is link or pointer.

Types of Linked List:
Following are the various types of linked list.
  1. Simple Linked List − Item navigation is forward only.
  2. Doubly Linked List − Items can be navigated forward and backward.
  3. Circular Linked List − Last item contains link of the first element as next and the first element has a link to the last element as previous.

No comments:

Post a Comment