GATE | GATE CS 1997 | Question 4
The concatenation of two lists is to be performed in O(1) time. Which of the following implementations of a list should be used?
singly linked list
doubly linked list
circular doubly linked list
array implementation of lists
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.
Quiz of this Question
Please comment below if you find anything wrong in the above post
My Personal Notes arrow_drop_up
Please Login to comment...