Start learning →

Order the binary search

Exercise and reference answers

Steps
  1. Make sure the list is sorted
  2. Look at the middle element
  3. Compare it with the key
  4. Discard the half that cannot hold it
  5. Repeat on the half that remains
Instructions
Tap the steps of a binary search in order.

Explanation

_Source: syllabus Computer Science, Ch 5 'Sorting' and Ch 6 'Searching'_
Continue learning with Quill →

Browse more GATE CSE questions and exercises →