What is the worst case time complexity of inserting \(n\) elements into an…

PYQ GATE 2020

What is the worst case time complexity of inserting nn elements into an empty linked list, if the linked list needs to be maintained in sorted order ?

  1. A.

    θ(n)\theta (n)

  2. B.

    θ(n log n)\theta (n \ log \ n)

  3. C.

    θ(n2)\theta (n^2)

  4. D.

    θ(1)\theta (1)

Attempted by 1444 students.

Sign up free to check your answer

Sign up free

Explore the full course: Zero To Hero

Loading lesson…