Use the buttons on the navigation bar to sort the array below!

QuickSort

Time complexity: Best: O(nlog(n)) | Average: O(nlog(n)) | Worst: O(n2)

Space complexity: O(log(n))

MergeSort

Time complexity: Best: O(nlog(n)) | Average: O(nlog(n)) | Worst: O(nlog(n))

Space complexity: O(n)

Bubble Sort

Time complexity: Best: O(n) | Average: O(n2) | Worst: O(n2)

Space complexity: O(1)

Insertion Sort

Time complexity: Best: O(n) | Average: O(n2) | Worst: O(n2)

Space complexity: O(1)

Selection Sort

Time complexity: Best: O(n2) | Average: O(n2) | Worst: O(n2)

Space complexity: O(1)

Welcome to Sorting visualiser!


How to select a sorting algorithm?

The Programmer must be aware of several interrelated and often conflicting efficiency considerations to make an intelligent choice about:
which sorting algorithm is the most appropriate to a particular problem.

What factors must be taken into consideration?

Choice of a competant programmer:

If a file is small, sophisticated sorting techniques designed to minimise the space and time are usually worse or only marginally better in efficiencies than simpler, generally less-efficient methods.

In many programming applications it is often necessary to sacrifice efficiency for clarity, with sorting this is usually opposite. Once, sorting program is written and tested, the programmer's chief goal must be to improve speed even if it becomes less readable.

Sounds good but how?