Awesome q2a theme
0 votes
3 views

Which of the following operations can be performed in $O(logn)$ time or faster on a sorted array $A$?($n$ denotes the size of array)

  1. Search$(A, x)$
  2. Find-Minimum$(A)$
  3. Delete$(A, x)$

Choose the correct option

  1. A, B & C
  2. B & C
  3. A & B
  4. A & C
in Others by (178 points) | 3 views

1 Answer

0 votes
A will take logn time using binary search.
B is O(1), as the array given is sorted.
C is O(n), as even though we can find the element in O(logn), we’ll have to move all the other elements after deletion.
by (203 points)
932 questions
596 answers
1,885 comments
81,474 users