Write a program to implement doubly linked list. Explain how, it is different from circular linked list?
Check out the simple one struct node { node(int data_p) { data=data_p; next=0; } int data; node *next; }; node *head=0; void addNode(int data) { node *curNode=head; if(head==0) { head=new node(data); return; } while(curNode->next) curNode=curNode->next; curNode->next=new node(data); } int main() { addNode(7); addNode(1); addNode(40); node *curNode=head; while(node) { cout << node->data; node=node->next; } } The difference is how many pointers each node has, and what they are pointing to. A linked list is comprised of “Nodes” each node contains data as well as 1 or more pointers. A singly linked list has one pointer per node, and a doubly linked list has 2 pointers per node. Some programs use several pointers per node. The purpose of these pointers is to hold the list together. In a singly linked list, you can view a node and can then move on to the next node that it is pointing to until you’ve passed through them all. A doubly-linked list would have a pointer to the next node as well a