...
JNU 2018-2 PhD CS
October 26, 2023
JNU 2018-2 PhD CS
October 26, 2023
JNU 2018-2 PhD CS
October 26, 2023
JNU 2018-2 PhD CS
October 26, 2023

JNU 2018-2 PhD CS

Question 19
The time complexity of inserting a node in a doubly linked list is
A
O(n2 log(n))
B
O(n log (n))
C
O(log (n))
D
O(n)
Question 19 Explanation: 
Strictly speaking an insertion is simply O(1). The other answers mostly correctly state that the complexity is O(n) if you need to search for the position in which to insert the new node
Correct Answer: D
Question 19 Explanation: 
Strictly speaking an insertion is simply O(1). The other answers mostly correctly state that the complexity is O(n) if you need to search for the position in which to insert the new node

Leave a Reply

Your email address will not be published. Required fields are marked *