Question 7Asked in DSSSB TGT Computer Science (Technical), 7 Aug 2021, Shift 2

Which of the following statement(s) is/are true about binary search algorithm?

Which of the following statement(s) is/are true about binary search algorithm? I. It is implemented on sorted array. II. One must have direct access to the middle element in any sub-list. III. It is implemented on sorted linked list.
  1. AII and III
  2. BI and III
  3. CI and II
  4. DI, II and III
Show answerHide answer

Correct answer: (C) I and II

Explanation

Binary search needs a sorted list with direct (random) access to the middle element, which an array provides. A linked list has no direct access to the middle, so III is false.

From DSSSB TGT Computer Science PYQ (Technical), 7 Aug 2021, Shift 2

This is question 7 of DSSSB TGT Computer Science PYQ (Technical), 7 Aug 2021, Shift 2. 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.