L Lan Anh New member Sep 16, 2021 #1 What is the worst case time complexity of inserting a node in a doubly linked list? A. O(nlogn) B. O(logn) C. O D. O(1)
What is the worst case time complexity of inserting a node in a doubly linked list? A. O(nlogn) B. O(logn) C. O D. O(1)
Ẽ Ẽm Thư New member Sep 16, 2021 #2 Answer: C Explanation: In the worst case, the position to be inserted maybe at the end of the list, hence you have to traverse through the entire list to get to the correct position, hence O. Upvote 0 Downvote
Answer: C Explanation: In the worst case, the position to be inserted maybe at the end of the list, hence you have to traverse through the entire list to get to the correct position, hence O.