What is the worst case time complexity of inserting a node in a doubly linked list?
A. O(nlogn)
B. O(logn)
C. O(n)
D. O(1)
Answer:C
What is the worst case time complexity of inserting a node in a doubly linked list?
A. O(nlogn) B. O(logn) C. O(n) D. O(1)
Explanation: In the worst case, the position to be inserted may be at the end of the list, hence you have to traverse through the entire list to get to the correct position, hence O(n).