Difference between circular linkedlist and double linkedlist
Answers
Explanation:
1)The structure of a node of singly linked circular list is as follows:-
Struct list_type
{
Int data;
Struct list_type *next;
}
2)Only one pointer is maintained in a node of singly list which contains the address of next node in sequence another will keep the address of.
3)In singly, we can not move in backward direction because each in node has next node pointer which facilitates us to move in forward direction.
4)During deletion of a node in between the singly list, we will have to keep two nodes address one the address of the node to be deleted and the node just previous of it.
DOUBLY LINKED CIRCULAR LIST
1)The structure of a node of doubly linked circular list is as follows:-
{
Int data;
Struct doubly_list *previous;
Struct doubly_list *next;
}
2)Two pointers are maintained in a node of doubly list, one will keep the address of first previous node and first next node in sequence.
3)In doubly list, we can move backward as well as forward direction as each node keeps the address of previous and next node in sequence.
4)During deletion, we have to keep only one node address i.e the node to be deleted. This node will give the address of previous node automatically.