Doubly linked list
Nodes in a doubly linked list are linked in both directions using next and previous pointer. Two consecutive elements are linked by previous and next pointer. Thus it is possible to traverse any direction from head to tail or from tail to head. The limitation of single linked list thus has been eliminated and most of the practical and applied list has this type of structure inside it. Find the visual representation of the doubly linked list in the below figure.
Doubly linked list - pictorial view
Doubly linked list source code
Output
Doubly linked list demo application Add a node [y/n] : y Value of this node : 1 Add a node [y/n] : y Value of this node : 10 Add a node [y/n] : y Value of this node : 100 Add a node [y/n] : n List Contains(sequence head to tail): Node 1, Value: 1 Node 2, Value: 10 Node 3, Value: 100 List Contains(sequence tail to head): Node 1, Value: 100 Node 2, Value: 10 Node 3, Value: 1
About our authors: Team EQA
You have viewed 1 page out of 248. Your C learning is 0.00% complete. Login to check your learning progress.
Learn on Youtube


Questions index C Questions C++ Questions Win32 MFC COM/DCOM DLL Questions