Multiple choice technology architecture

Which of the following is not the required condition for binary search algorithm?

  1. The list must be sorted

  2. there should be the direct access to the middle element in any sublist

  3. There must be mechanism to delete and/or insert elements in list

  4. none of above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Binary search requires the search space/list to be sorted and allows random access to the middle element to achieve logarithmic time complexity. It does not require a mechanism to insert or delete elements; in fact, binary search is often performed on static arrays.