Singly Linked Lists vs. Doubly Linked Lists
Let's see how the two renditions of the linked list structure fare against each other.
We'll cover the following
Which is Better? #
DLLs has a few advantages over SLLs
- Doubly linked lists can be traversed in both directions, which makes them more compatible with complex algorithms.
- Operations involving tail become much faster. Deletion at the tail is one such example.
These benefits entail the cost of extra memory:
- Nodes in doubly linked lists require extra memory to store the
previousElement
pointer.
Lets’s look at the implementation of delete at the tail operation to see the real power of a DLL.
Level up your interview prep. Join Educative to access 80+ hands-on prep courses.