Trimble MAPS interview question

basically to write a binary search function