public static int getLastK(int[] array,int length ,int start,int end,int k){
		if(start > end){
			return -1;
		}
		int midPos = start + (end - start)/2;
		int midData = array[midPos];
		if(midData == k){
			if( (midPos != length && array[midPos+1] != k) || midPos == length ){
				return midPos;
			}else{
				start = midPos + 1;
			}
			
		}
		else if(midData > k){
			end = midPos - 1;
		}else{
			start = midPos + 1;
		}
		return getLastK(array,length,start,end,k);
		
	}