Find a number in a matrix which is sorted left to right and top to bottom.
hint: start from the top left corner
Avi
Avi Dullu's Code Arena
START FROM THE TOP LEFT CORNER ... if the number to be searched is more then a[0][1] and a[1][0] the move to a[1][1] else if number is greater then a[o][1] but less then a[1][0]
move to a[0][1] and apply same process again ..keep on checking the equivalence at each step...
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks