Question 39

Which of the following search algorithm requires a sorted array ?

  1. ALinear search
  2. BHash search
  3. CBinary search
  4. DAll of these
Show answerHide answer

Correct answer: (C) Binary search

Explanation

Binary search repeatedly halves the search range by comparing with the middle element, which only works if the array is sorted. Linear search works on unsorted data.

From DSSSB TGT Computer Science Practice Set 4

This is question 39 of DSSSB TGT Computer Science Practice Set 4. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.