This test is run by .
Note that your final mark will not be saved in the system.
Note that your final mark will not be saved in the system.
4 - Algorithms Typeit
Target Level
C
Running Total
0
0%
Attempt
1 of 3
Type the correct answers into the spaces. Fill all the spaces before clicking ‘Check Answers!’
A poorly-conceived binary search
The following array was subject to a binary search. This was a poorly-chosen algorithm, since the elements within the array are not in order. The algorithm works under the assumption that the array is in ascending numerical order.
10 | 23 | 2 | 32 | 16 | 30 | 28 | 1 | 22 | 4 | 33 | 7 | 24 | 12 | 13 | 27 | 15 | 25 | 9 | 6 | 18 | 11 | 26 | 5 | 21 | 31 | 19 | 14 | 29 | 3 | 17 | 20 | 8 |
During each iteration, the first step is to identify the midpoint. If the current search field has an number of values, the midpoint is simply the one in the middle. With an number of values, there would be two values in the middle, and the midpoint is taken as being the one on the left.
Write out, in order, the values that would be encountered in an attempt to find the number 14.
- - - - -