Which of the following operations is not O(1) for an array of sorted data. You…

2025

Which of the following operations is not O(1) for an array of sorted data. You may assume that array elements are distinct.

  1. A.

    Find the ith largest element

  2. B.

    Delete an element

  3. C.

    Find the ith smallest element

  4. D.

    All of the above

Attempted by 770 students.

Show answer & explanation

Correct answer: B

Explanation:

The worst case time complexity for deleting an element from array can become O(n).

Explore the full course: Cognizant Preparation