Back to Showcase
Comparisons: 0
Swaps: 0
Time: 0.00s

Bubble Sort

Repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order.

Time: O(n²) Space: O(1) Stable: Yes
Steps: 0
Target: 42
Found at: -

Linear Search

Sequentially checks each element of the list until a match is found or the whole list has been searched.

Time: O(n) Space: O(1) Sorted Required: No

Algorithm Race

Pick two sorting algorithms. Same data, same speed. Who wins?

VS

Merge Sort

Comparisons: 0 Swaps: 0 Time: 0.00s

Bubble Sort

Comparisons: 0 Swaps: 0 Time: 0.00s

Sorting Algorithms

Bubble Sort

Simple comparison-based sorting. Repeatedly swaps adjacent elements if they're in wrong order.

O(n²) Easy

Selection Sort

Finds the minimum element and places it at the beginning. Repeats for remaining elements.

O(n²) Easy

Insertion Sort

Builds sorted array one item at a time by inserting each element into its correct position.

O(n²) Easy

Merge Sort

Divide and conquer algorithm. Divides array in half, sorts each half, then merges them.

O(n log n) Medium

Quick Sort

Picks a pivot element and partitions array around it. Highly efficient in practice.

O(n log n) Medium

Heap Sort

Builds a max heap from the array, then repeatedly extracts the maximum element to build the sorted result.

O(n log n) Medium

Shell Sort

Generalization of insertion sort that compares elements far apart, then progressively reduces the gap.

O(n log n) Medium

Counting Sort

Non-comparison sort that counts occurrences of each value, then reconstructs the sorted output.

O(n + k) Medium

Search Algorithms

Linear Search

Checks every element one by one until target is found. Works on unsorted arrays.

O(n) Easy

Binary Search

Divides search interval in half repeatedly. Requires sorted array. Very efficient.

O(log n) Medium

Jump Search

Jumps ahead by fixed steps, then does linear search. Balance between linear and binary.

O(√n) Medium

Exponential Search

Finds a range where the target might be by doubling the index, then performs binary search in that range.

O(log n) Medium

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

0 Total Runs
- Most Used
- Fastest Avg
- Fewest Ops

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!