A workspace for curious programmers

A little clarity.
A better algorithm.

From your first idea to the final submission. Write C++, test your thinking, and understand how your code grows.

No setup. No account required. Just start building.

solution.cppC++17
01// Find the answer. Skip the noise.
02int binary_search(int target) {
03  int lo = 0, hi = n - 1;
04  while (lo <= hi) {
05    int mid = lo + (hi - lo) / 2;
06    if (a[mid] == target) return mid;
07    if (a[mid] < target) lo = mid + 1;
08    else hi = mid - 1;
09  }
10  return -1;
11}
Time complexityO(log n)
Half the search.
Every step.
A binary search on a sorted array · illustration
Built for the way you solve.C++17Browser executionTime + space analysisLocal-first files

01 / Your toolkit

Less friction.
More figuring it out.

Everything you need to explore a solution,
with room to focus on what matters.

02 / A sense of scale

Small input.
Big difference.

Two solutions can feel equally fast. Then the input grows. Move the slider to see why complexity matters.

Illustrative operation counts, not benchmarks. Both chart axes use a logarithmic scale.

operations / input sizeInteractive
How algorithm growth rates compareLogarithmic, linear, linearithmic, and quadratic operation counts as input grows from 10 to 100,000 elements. Exact values appear below.10¹⁰10⁶10²1101001K10K100K
O(log n)10
O(n)1K
O(n log n)10K
O(n²)1M

Prefer the terminal?

Same insight.
Your own command line.

Get the native CLI
~/projects/next-solution$ algovis analyze solution.cpp
Time: O(n * log n)Space: O(n)