private int partition(int lo, int hi) {
        System.out.println(this);
        int i = lo;
        int j = hi+1;
        T pivot = elements[lo];
        while (true){
            while(less(elements[++i], pivot)){
                if(i==hi) break;
            }
            while(less(pivot,elements[--j])){
                if(j==lo) break;
            }
            if (i>=j) break;
            exch(i,j);
        }
        exch(lo,j);
        System.out.println(this);
        System.out.println(j+1);
        return j;
    }