Which of the following search algorithms requires a sorted array?
2022
Which of the following search algorithms requires a sorted array?
- A.
Linear search
- B.
Hash search
- C.
Binary search
- D.
All of these
Attempted by 1182 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.