Clevix Ed

Sorting Algorithms

Coding & AI · Class 9–12 · Algorithms

All simulations
Press Play or Step to sort the bars

What to explore

Key ideas

Big-O describes how the work grows as the input size n grows.

Bubble, selection, insertion: O(n²)
Merge sort: O(n log n) always · Quick sort: O(n log n) on average

Bubble sort makes up to n(n − 1)/2 comparisons. For n = 1000 that is about 500 000, while n log₂ n is about 10 000.

Teacher tip

Hand out numbered cards and let groups sort them by hand using one algorithm each. Count comparisons on the board, then check them against the simulation.

Link to Class 11 and 12 Computer Science: write each algorithm in Python after watching it.

Exam corner

In your syllabus

A free coding & ai simulation for Class 9–12 and Olympiad.

Topics: sorting, bubble sort, merge sort, quick sort, insertion sort, big O, algorithms, complexity