Which of the following operations is not ( O(1) ) for an array of sorted data? You may assume) that array elements are distinct
1. Find the \( i^{th} \) largest element: \[\] In a sorted array, finding the \( i^{th} \) largest element can be done directly by indexing, which is ( O(1) ). \[\] 2. Delete an element: \[\] Deleting an element from a sorted array requires shifting all elements after the deleted element to maintain the sorted order. This operation has a time complexity of ( O(n) ), not ( O(1) ). \[\] 3. Find the \( i^{th} \) smallest element: \[\] In a sorted array, finding the \( i^{th} \) smallest element can be done by simple indexing, which is ( O(1) ). \[\] Correct Option: (b)
Reinforce your conceptual grasp with related questions from CUET-MCA 2021:
Take timed full-length mock tests with authentic question distributions, negative marking (+12/-3 in Math), and instant All India Rank calculation.
Start Free Mock Test Series →