Quicksort implementation in Java
1

I would declare &lt;E extends Comparable&gt; void sort(ArrayList&lt;E&gt; arr) as &lt;E extends Comparable&lt;? super E&gt;&gt; void sort(ArrayList&lt;E&gt; arr)

2

void sort(int left, int right, ArrayList&lt;E&gt; arr) {
    ...
}


I suggest you make it public and reorganize the arguments like this:

void sort(ArrayList&lt;E&gt; arr, int fromIndex, int toIndex)


where fromIndex corresponds to left in your version, and toIndex corresponds to right + 1: these are the conventions in JDK's sort algorithms, so that toIndex is an exclusive upper bound.

3

I would make the three-parameter version public since sometimes people want to sort only a subrange of an array (or ArrayList in our case).

4

Declare the constructor as private:

private Quicksort() {}


Hope that helps.