VisualAlgorithms

Swipe to switch tabs
Comparisons: 0  |  Swaps: 0  |  Accesses: 0  |  Time: 0.00s
.json, .txt, .csv

Step-by-Step Mode

Execute sorting one step at a time with pseudocode highlighting

Step: 0 / 0
Generate an array and start stepping.
Comp: 0 Swaps: 0 Accesses: 0
Comparing
Swapping
Sorted
Pseudocode

Algorithm Race

Race algorithms against each other on identical data

2 racers ready

Benchmark

Run performance tests at full speed for objective comparisons

Select Algorithms

Average: Full Report: Quick Copy:

Algorithm Encyclopedia

Quick reference for any algorithm

Best Time—
Average Time—
Worst Time—
Space—
Stable—
In-Place—
Select an algorithm to see details.

Data Export

Export your session data

Includes all sorts, benchmarks, and race data from this session.

Dataset Analyzer

Upload a massive dataset to analyze its entropy and find the optimal sorting algorithm.

Upload CSV or JSON Files

Up to 10 files, 1,000,000 items each

▶ Advanced Mode Tune analysis parameters
Auto
2,000
2M
15%
Use WebGL for sortedness/runs on large datasets (>10K elements)

Analyzing Dataset Entropy...

Running mathematical profiling in background worker.

Mathematical Profile

GPGPU Accelerated
0%
Sortedness
0
Unique Elements
0
Reverse Runs
0.00
Standard Deviation
▶ Data Visualization
▶ Advanced Analysis Information Theory, Run Structure, Statistical Moments
Information Theory
0.00
Shannon Entropy
0%
Normalized Entropy
0
Inversions
0%
Inversion Ratio
Run Structure
0
Natural Runs
0
Longest Sorted Run
--
Distribution Type
0%
MC Lilliefors
Statistical Moments
--
Mean
--
Median
--
Min
--
Max
--
Range
--
Skewness
--
Kurtosis
--
IQR

Recommendation

Based on the analysis, we recommend...

Export Results

Custom Algorithm Sandbox

Write your own sorting algorithm using Code or Blocks

⋮⋮
Editor
Loading runtime...
▶ API: define customSort(arr, n, { compare, swap, set }) — runs synchronously
How it runs: define a function named customSort (JavaScript/C/C++), custom_sort (Python), or CustomSort (C#). It is called once with the array and the helper API, and runs synchronously — you do not use await or sleep; the animation is generated from the operations you perform.

Signature:
  JS: function customSort(arr, n, { compare, swap, set })
  Python: def custom_sort(arr, n, api) (call api.compare(i, j), etc.)
  C#: public void CustomSort(int[] arr, int n, dynamic api)
  C/C++: void customSort(int arr[], int n, ...) with global compare/swap/set

Parameters & helpers:
arr: the array being sorted. Read a value directly with arr[i] (used by merge-style algorithms).
n: the number of elements (same as arr.length).
compare(i, j): returns a number < 0 if arr[i] < arr[j], > 0 if greater, 0 if equal. Counts a comparison.
swap(i, j): swaps the elements at indices i and j. Counts a swap.
set(i, val): writes val into index i (use when you compute values into a temporary buffer, e.g. merge sort).

Tip: operate by index through compare/swap/set so every step is animated. Pick a ready-made algorithm from the template dropdown to see a full working example.
⋮⋮
Comp: 0 Swaps: 0 Accesses: 0
⋮⋮
Console