Bubble Sort
Repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order.
Linear Search
Sequentially checks each element of the list until a match is found or the whole list has been searched.
Algorithm Race
Pick two sorting algorithms. Same data, same speed. Who wins?
Merge Sort
Bubble Sort
Sorting Algorithms
Bubble Sort
Simple comparison-based sorting. Repeatedly swaps adjacent elements if they're in wrong order.
Selection Sort
Finds the minimum element and places it at the beginning. Repeats for remaining elements.
Insertion Sort
Builds sorted array one item at a time by inserting each element into its correct position.
Merge Sort
Divide and conquer algorithm. Divides array in half, sorts each half, then merges them.
Quick Sort
Picks a pivot element and partitions array around it. Highly efficient in practice.
Heap Sort
Builds a max heap from the array, then repeatedly extracts the maximum element to build the sorted result.
Shell Sort
Generalization of insertion sort that compares elements far apart, then progressively reduces the gap.
Counting Sort
Non-comparison sort that counts occurrences of each value, then reconstructs the sorted output.
Search Algorithms
Linear Search
Checks every element one by one until target is found. Works on unsorted arrays.
Binary Search
Divides search interval in half repeatedly. Requires sorted array. Very efficient.
Jump Search
Jumps ahead by fixed steps, then does linear search. Balance between linear and binary.
Exponential Search
Finds a range where the target might be by doubling the index, then performs binary search in that range.
Complexity Comparison
| Algorithm | Best | Average | Worst | Space |
|---|---|---|---|---|
| Bubble Sort | O(n) | O(n²) | O(n²) | O(1) |
| Selection Sort | O(n²) | O(n²) | O(n²) | O(1) |
| Insertion Sort | O(n) | O(n²) | O(n²) | O(1) |
| Merge Sort | O(n log n) | O(n log n) | O(n log n) | O(n) |
| Quick Sort | O(n log n) | O(n log n) | O(n²) | O(log n) |
| Heap Sort | O(n log n) | O(n log n) | O(n log n) | O(1) |
| Shell Sort | O(n log n) | O(n^1.25) | O(n²) | O(1) |
| Counting Sort | O(n + k) | O(n + k) | O(n + k) | O(k) |
| Exponential Search | O(1) | O(log n) | O(log n) | O(1) |
Performance Analytics
Track and compare algorithm performance across your sessions
Average Time by Algorithm
Average Operations
Performance Over Time
Run History
| Algorithm | Type | Size | Comparisons | Swaps/Steps | Time | Date |
|---|---|---|---|---|---|---|
| No runs recorded yet. Start sorting or searching! | ||||||