search 2d matrix

two methods. both using binary search.