In a doubly linked list containing n elements, how much time will it take to…

In a doubly linked list containing n elements, how much time will it take to find the 4th node from the end, assuming only a pointer to the head of the list is available?

  1. A.

    O(n2)

  2. B.

    O(n)

  3. C.

    O(n log n)

  4. D.

    O(1)

Attempted by 694 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…