Why binary search algorithm did not work on an unsorted array?
The binary search algorithm works by successively halving the
array and determining which half the result lies in, or if the
half-way point is the result. In order for that to work, the array
must be in order, otherwise choosing the half-way point would be
meaningless because it would not tell you which half of the array
the result is located in.