title: Find place for number in array using binary search
body: <p>I have an array of numbers , say nums[n] . I have to find position 'i' such that nums[i] is greatest among all integers which are less than key . nums is sorted . I know i can do this using linear search from i=0 till position where nums[i]>=key . But i want to do it faster , so could anyone tell algo of required binary search ?</p>
  
  <p>Example : nums[]={2,4,14,25} and key=15 . Therefore  i should be 2 as 14 is greatest integer among all other integers less than 15 .</p>