Q: What is the time complexity of removing an element from a doubly linked list with n elements, given a reference to the node to be deleted?
-
A
O(1)
-
B
O(log n)
-
C
O(n)
-
D
O(n^2)
A
Answer:
A
Explanation:
Removing an element from a doubly linked list, given a reference to the node to be deleted, can be done in constant time. In a doubly linked
Related Topic:
Share Above MCQ