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 869 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…