Is this quicksort efficient and acceptable? In order to complete one of my assignment I needed to include a quicksort so I was wondering if this is correct and acceptable. 

The code: 

    private ArrayList&lt;String&gt; sort(ArrayList&lt;String&gt; ar, int lo, int hi){
        if (lo &lt; hi){
            int splitPoint = partition(ar, lo, hi);
            sort(ar, lo, splitPoint);
            sort(ar, splitPoint +1, hi);
        }
        return ar;
    }

    private int partition(ArrayList&lt;String&gt; ar, int lo, int hi){
        String pivot = ar.get(lo);
        lo--;
        hi++;
        while (true){
            lo++;
            while (lo&lt;hi &amp;&amp; ar.get(lo).compareTo(pivot) &lt; 0){
                lo++;
            }
            hi--;
            while (hi&gt;lo &amp;&amp; ar.get(hi).compareTo(pivot) &gt;= 0){
                hi--;
            }
            if (lo&lt;hi){
                swap(ar, lo, hi);
            }else {
                return hi;
            }
        }
    }


The additional swap method: 

    private ArrayList&lt;String&gt; swap(ArrayList&lt;String&gt; ar, int a, int b){
        String temp = ar.get(a);
        ar.set(a, ar.get(b));
        ar.set(b, temp);
        return ar;
    }


If this is incorrectly done can you please give me some pointers and tell me why. Otherwise I would gladly accept any suggestions you have.
Those are pure functions that don't access any instance variables.  You can therefore make them static.

You could use generics more generically.  Your code should work with any List, as long as it supports an efficient .get(i) for arbitrary i.  The elements of the list can be any kind of Comparable object.

The .sort() function should have a void return type to avoid giving the false impression that it returns a copy of the original array.

private static &lt;E extends Comparable&lt;E&gt;, L extends List&lt;E&gt; &amp; RandomAccess&gt;
void sort(L ar, int lo, int hi) {
    if (lo &lt; hi) {
        int splitPoint = partition(ar, lo, hi);
        sort(ar, lo, splitPoint);
        sort(ar, splitPoint +1, hi);
    }
}

private static &lt;E extends Comparable&lt;E&gt;, L extends List&lt;E&gt; &amp; RandomAccess&gt;
int partition(L ar, int lo, int hi){
    E pivot = ar.get(lo);
    lo--;
    hi++;
    while (true){
        lo++;
        while (lo&lt;hi &amp;&amp; ar.get(lo).compareTo(pivot) &lt; 0){
            lo++;
        }
        hi--;
        while (hi&gt;lo &amp;&amp; ar.get(hi).compareTo(pivot) &gt;= 0){
            hi--;
        }
        if (lo&lt;hi){
            swap(ar, lo, hi);
        }else {
            return hi;
        }
    }
}

private static &lt;E extends Comparable&lt;E&gt;, L extends List&lt;E&gt; &amp; RandomAccess&gt;
void swap(L ar, int a, int b){
    E temp = ar.get(a);
    ar.set(a, ar.get(b));
    ar.set(b, temp);
}