The concatenation of two lists is to be performed In 0(1) time. Which of the following implementations of a list should be used?
A
Doubly linked list
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
Singly linked list
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
Circular doubly linked list
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
D
Array implementation of list
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution
The correct option is C Circular doubly linked list As list concatenation requires traversing at least one list to the end. So singly linked list and doubly linked list requires O(n) time complexity whereas circular doubly linked list required O(1) time.