public int search(int key){
		
		int curr;
		int higherbound=len-1;
		int lowerbound=0;
		
		while(true){
			
			curr=(higherbound+lowerbound)/2;
			
			if(array[curr]==key)
				return curr;
			else if(higherbound<lowerbound)
				return -1;
			else{
				if(key>array[curr])
					lowerbound=curr+1;
				else 
					higherbound=curr-1;			
			}
			
			
		}
		
	}