Quick sort implementation in java