what if you write bin_search as this
//assumption array is in ascending order
binsearch(high, low, key, a)
begin
 if low > high
   return -1
 mid = (high+low)/2
 if a[mid] = key And a[mid+1] > key
   return mid
 if a[mid] <= key
   low = mid+1
 else
   high = mid - 1
 return binsearch(high,low,key,a)
end

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to