Sorting Algorithm Simulator

Past Tests

Configure and Run

Generated List:
No list generated yet.

Learn More About Sorting Algorithms

Quick Sort

Quick Sort is a highly efficient sorting algorithm based on partitioning an array into subarrays. It works by selecting a pivot element and rearranging elements such that all elements less than the pivot come before it, and all greater elements come after. This process is recursively applied to subarrays.

  • Time Complexity: O(n log n) (average), O(n²) (worst case)
  • Space Complexity: O(log n)

Quick Sort Visualization

50
40
70
20
90
10
60

Heap Sort

Heap Sort is a comparison-based sorting algorithm that uses a binary heap data structure. It starts by building a max-heap, then repeatedly extracts the maximum element and rebuilds the heap until all elements are sorted.

  • Time Complexity: O(n log n)
  • Space Complexity: O(1)

Heap Sort Visualization

50
40
70
20
90
10
60

Shell Sort

Shell Sort is an algorithm that sorts an array based on specific intervals and then refines the sorting as these intervals decrease.

  • Time Complexity: Average O(n log² n)
  • Space Complexity: O(1)

Shell Sort Visualization

53
40
70
26
90
118
60

Merge Sort

Merge Sort is a divide-and-conquer algorithm that splits the array into halves, sorts each half, and then merges the sorted halves back together. It is particularly useful for sorting large datasets.

  • Time Complexity: O(n log n)
  • Space Complexity: O(n)

Merge Sort Visualization

50
40
70
20
90
10
60

Radix Sort

Radix Sort is a non-comparative sorting algorithm that sorts numbers by processing individual digits. It groups numbers based on their digit values starting from the least significant digit (LSD) or most significant digit (MSD).

  • Time Complexity: O(nk), where k is the number of digits
  • Space Complexity: O(n + k)

Radix Sort Visualization

170
45
75
90
802
24
2