iitb.con.util
Class Int2DBinarySearch

java.lang.Object
  extended by iitb.con.util.Int2DBinarySearch

public class Int2DBinarySearch
extends java.lang.Object

Integer Binary search for 2D integer array. The search is performed on the specified column and the column need to be sorted before the search.


Constructor Summary
Int2DBinarySearch()
           
 
Method Summary
static int locate(int[][] a, int key, int col)
          Binary search of on 2d integer array
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Int2DBinarySearch

public Int2DBinarySearch()
Method Detail

locate

public static int locate(int[][] a,
                         int key,
                         int col)
Binary search of on 2d integer array

Parameters:
a - array of sorted values to be searched.
key - value to be located
Returns:
returns index of the first match, or -insertion_position