BlackBerry interview question

write a binary search algorithm