Which of the following search algorithms requires a sorted array?

2022

Which of the following search algorithms requires a sorted array?

Answer: C. Binary searchBinary search works only on sorted arrays. It repeatedly divides the array into halves and compares the middle element with the target value.

  1. A.

    Linear search

  2. B.

    Hash search

  3. C.

    Binary search

  4. D.

    All of these

Attempted by 1729 students.

Show answer & explanation

Correct answer: C

Binary search works only on sorted arrays. It repeatedly divides the array into halves and compares the middle element with the target value.

Explore the full course: Niacl Ao It Specialist

Loading lesson…