![]() |
What is the advantage of doubly linked list over linear linked list?In: C Programming |
[Edit] |
[Edit]
A doubly linked list can be traversed in both directions (forward and backward). A singly linked list can only be traversed in one direction.
A node on a doubly linked list may be deleted with little trouble, since we have pointers to the previous and next nodes. A node on a singly linked list cannot be removed unless we have the pointer to its predecessor.
A node on a doubly linked list may be deleted with little trouble, since we have pointers to the previous and next nodes. A node on a singly linked list cannot be removed unless we have the pointer to its predecessor.
On the flip side however, a doubly linked list needs more operations while inserting or deleting and it needs more space (to store the extra pointer).
First answer by Avir. Last edit by Azeemferoz. Contributor trust: 2 [recommend contributor]. Question popularity: 9 [recommend question]





