public int findMin(int[] num) {
    	int b = 0;
    	int e = num.length - 1;
    	int m = 0;
    	while(b<e){
//    		System.out.println(b + ":" + m + ":" + e);
    		m = (b+e)/2;
    		if(m==b || m==e)
    			return num[b]<num[e] ? num[b]: num[e];
    		if(num[m] > num[e]) b = m;
    		else{
    			e = m;
    		}
    	}
        return num[m];
    }