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

GATE · 2020 · CS · Computer Science & IT

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

  1. A.

    \(\theta (n)\)

  2. B.

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

  3. C.

    \(\theta (n^2)\)

  4. D.

    \(\theta (1)\)

Attempted by 1211 students.

Show answer

Correct answer: C

The worked solution is available to enrolled students.

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

Loading lesson…