Singly Linked List Vs Doubly Linked List
Singly Linked List Vs Doubly Linked List
SLL nodes contains 2 field -data field DLL nodes contains 3 fields -data field, a
and next link field. previous link field and a next link field.
The SLL occupies less memory than The DLL occupies more memory than SLL as
DLL as it has only 2 fields. it has 3 fields.
We mostly prefer to use singly linked We can use a doubly linked list to execute
list for the execution of stacks. heaps and stacks, binary trees.
1 In case of singly linked lists, the complexity of In case of doubly linked lists, the complexity
insertion and deletion is O(n) of insertion and deletion is O(1)
2 The Singly linked list has two segments: data The doubly linked list has three segments.
and link. First is data and second, third are the pointers.
4 We mostly prefer a singly linked list for the We can use a doubly linked list to execute
execution of stacks. binary trees, heaps and stacks.
5 When we want to save memory and do not need In case of better implementation, while
to perform searching, we prefer a singly linked searching, we prefer a doubly linked list.
list.
6 A singly linked list consumes less memory as The doubly linked list consumes more
compared to the doubly linked list. memory as compared to the singly linked list.