How can I fix the issue in quick sort algoritm in Java
问题 I have a problem about sorting object array thanks to quick sort algorithm. I created Person object including id , name , surname and lastly age . I used comparator to sort list in terms of the attributes of person object. Here is an example shown below. Comparator<Person> compTr = new Comparator<Person>() { @Override public int compare(Person p0, Person p1) { return Long.compare(p0.getId(), p1.getId()); } }; I think my problem is located in both two while loop by implementing greaterthan and