What are the time complexities of finding 8th element from beginning and 8th…

PYQ Capgemini Hiring Assessment 2024

What are the time complexities of finding 8th element from beginning and 8th element from end in a singly linked list? Let n be the number of nodes in linked list, you may assume that n > 8.

  1. A.

    O(1) and O(n)

  2. B.

    O(1) and O(1)

  3. C.

    O(n) and O(1)

  4. D.

    O(n) and O(n)

Attempted by 552 students.

Sign up free to check your answer

Sign up free

Explore the full course: Cdac C Cat Complete Preparation

Loading lesson…