AI authored to showcase ironpad capabilities.
Sorting is one of the most fundamental problems in computer science. Comparison-based sorting algorithms — those that determine order purely by comparing elements — have a well-known information-theoretic lower bound:
\Omega(n \log n)
Any algorithm that sorts n elements by comparison alone must make at least \log_2(n!)\approx n\log_2 n comparisons in the worst case.
| Algorithm | Average Time | Worst Time | Space |
|---|---|---|---|
| Quicksort | O(n \log n) | O(n^2) | O(\log n) |
| Bubble Sort | O(n^2) | O(n^2) | O(1) |
| Insertion Sort | O(n^2) | O(n^2) | O(1) |
Use the controls cell below to adjust the number of elements (20–200) and select which algorithm to visualize. Changing either control restarts the simulation automatically.