Google News
logo
Algorithm - Quiz(MCQ)
Identify the description of a binary search
A)
Put the elements in order, check each item in turn
B)
Elements do not need to be in order, check each item in turn
C)
Elements do not need to be in order, compare to the middle value, split the list in order and repeat
D)
Take an ordered list, compare the search value to the middle value, if it's higher than the middle take the right side of the list otherwise take the left and repeat

Correct Answer :   Take an ordered list, compare the search value to the middle value, if it's higher than the middle take the right side of the list otherwise take the left and repeat

Advertisement