logo CodeStepByStep logo

binary_search_mc1

Language/Type: Python searching binary search
Related Links:

Given the following sorted list of integers:

#      0   1   2   3   4   5   6   7   8   9  10  11  12  13
a = [-23, -5,  9, 14, 15, 18, 23, 24, 25, 27, 34, 62, 85, 87]

What indexes are examined in a binary search for each value, and what value is returned?

sequential search for 27
(order shuffled)
binary search for 27
(order shuffled)

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.