FIFA world cup

32 teams qualified for the FIFA 2018 World Cup. If the names of the teams were arranged in sorted order (an array), how many items in the array would binary search have to examine to find the location of a particular team in the array, in the worst case?

At most, 6. At most, 32. At most, 1. At most, 16.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Hasmik Garyaka
Sep 19, 2017

Use binary search with log2 comparisons. First try 16, and then 8 or 24 and so on.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...