Quicksort implementation with pivotal calculated as middle element I read quick sort algorhitm and implemented in like this:

public List&lt;Integer&gt; sort(List&lt;Integer&gt; list) {
    if (list.size() &lt;= 1) {
        return list;
    }

    int pivotalValue = list.get(list.size() / 2);

    List&lt;Integer&gt; left = new ArrayList&lt;&gt;();
    List&lt;Integer&gt; pivotalValues = new ArrayList&lt;&gt;();
    List&lt;Integer&gt; right = new ArrayList&lt;&gt;();
    for (Integer element : list) {
        if (element &lt; pivotalValue) {
            left.add(element);
        } else if (element &gt; pivotalValue) {
            right.add(element);
        } else {
            pivotalValues.add(element);
        }
    }
    List&lt;Integer&gt; sortedLeft = sort(left);
    List&lt;Integer&gt; sortedRight = sort(right);
    sortedLeft.addAll(pivotalValues);
    sortedLeft.addAll(sortedRight);
    return sortedLeft;

}


What do you think about my implementation?
What do you think about my implementation?


To tell you the truth, I don't think much of your implementation.  Instead of in-place swaps you're creating a bunch of temporary lists and combining them after.  It probably more closely resembles a merge sort than a quick sort.

Creating all those lists and merging them together requires many more iterations than the usual quick sort.

Altogether, it seems to me, that both the time and space complexity is worse than the usual quick sort.