partitioning algo in java for qsort