Circular Doubly Link List is data structure which contains a list of node containing info part and links to the next and previous node. In CDLL, last node's next pointer points to the first node and first node's previous pointer points to last node of the list. This makes traversal in both direction of CDLL. Before going to discuss the operation on circular doubly link list, we will first see the basic structure of the data type and see how it could be represented in c programming. First we will see the how the node or element of circular doubly link list is represented. See the image below:
The component of circular doubly list node:
The component of circular doubly link list are:
Now we will see the different operations that can be performed on the circular doubly link list:
The component of circular doubly list node:
- info : It contains the actual information
- next : This field points to the next node in the list
- prev : This field points to the previous node in the list
The component of circular doubly link list are:
- START pointer points to the first node of the list
- NODE : Each node have info field, next pointer to point next NODE in the list and prev pointer to point previous node in the list
- PREV of first node points to last node and NEXT of last node will points to first node
struct node{
int info;
struct node *next, *prev;
};
typedef struct node NODE;
Now we will see the different operations that can be performed on the circular doubly link list:
Comments
Post a Comment