based on Binary Search algorithm http://en.wikipedia.org/wiki/Binary_search_algorithm