Foundation Module
Sorting & Searching
Explore the classic algorithms that form the backbone of computer science: from simple comparisons to divide-and-conquer mastery.
10 hours
4 key concepts
Sorting Visualizer
Interactive
Bubble Sort
Repeatedly swaps adjacent elements if they are in wrong order
15
0
Comparisons
0
Swaps
0
Steps
Unsorted
Comparing
Pivot
Sorted
Algorithm Comparison
| Algorithm | Best Case | Average Case | Worst Case | Space | Stable |
|---|---|---|---|---|---|
| Bubble Sort | O(n) | O(n²) | O(n²) | O(1) | Yes |
| Selection Sort | O(n²) | O(n²) | O(n²) | O(1) | No |
| Insertion Sort | O(n) | O(n²) | O(n²) | O(1) | Yes |
| Merge Sort | O(n log n) | O(n log n) | O(n log n) | O(n) | Yes |
| Quick Sort | O(n log n) | O(n log n) | O(n²) | O(log n) | No |
Chapters
1
InteractiveElementary Sorting
Simple but instructive sorting algorithms
Bubble Sort O(n²)Selection Sort O(n²)Insertion Sort O(n²)
2
InteractiveDivide & Conquer Sorting
Efficient O(n log n) sorting algorithms
Merge Sort O(n log n)Quick Sort O(n log n)Heap Sort O(n log n)
3
InteractiveSearching Algorithms
Finding elements efficiently
Linear Search O(n)Binary Search O(log n)Search Variations O(log n)
Ready for graphs?
Explore graph traversal, shortest paths, and network algorithms.