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?

  1. A.

    O(n)

  2. B.

    O(log² n)

  3. C.

    O(log n)

  4. D.

    O(1)

Attempted by 811 students.

Show answer

Correct answer: A

The worked solution is available to enrolled students.

Explore the full course: Iocl Engineers Officers Grade A Paper 2

Loading lesson…