public static int partition(int[] nums,int low,int high)
    {
    	int i=low+1;
    	int j=high;
    	//System.out.println("i"+i+"j"+j);
    	while(true)
    	{
    		while(nums[i]>nums[low])
    		{
    			if(i==high)
    				break;
    			i++;
    		}
    		
    		while(nums[j]<nums[low])
    		{
    			if(j==low)
    				break;
    			j--;
    		}
    		
    		if(i>=j)
    			break;
    		
    		int tmp=nums[i];
    		nums[i]=nums[j];
    		nums[j]=tmp;
    	}
    	
    	int t=nums[j];
    	
    	nums[j]=nums[low];
    	
    	nums[low]=t;
    	
    	return j;
    }