Let P be a singly linked list accessible from its head, and let Q point…
GATE · 2004 · IT
Let P be a singly linked list accessible from its head, and let Q point directly to an intermediate (non-tail) node x. To delete node x itself (free its storage without changing another node’s identity), what is the worst-case time complexity of the best known algorithm?
- A.
O(n)
- B.
O(log² n)
- C.
O(log n)
- D.
O(1)
Attempted by 811 students.
Show answer
Correct answer: A
Explore the full course: Iocl Engineers Officers Grade A Paper 2
Loading lesson…