Skip to content

fig. 01

Watch the algorithm run. Then write it.

Read a short lesson, step through a visualization of the algorithm, then write it in Python, Java, JavaScript or C++ and let the tests grade it. Every page works in English and Arabic.

Read it, watch it, write it

  1. 01 · read

    A short lesson

    One idea, examples, and what to watch out for.

  2. 02 · watch

    Step through it

    Play, pause and go back one step at a time.

  3. 03 · write

    Code it, get graded

    Hidden tests run in a sandbox. Points are yours.

§ course map

What's inside

Every module, in the order to take it.

fig. 02 · growth

How the work grows

The growth classes you meet in the lessons. Move n to see how many operations each one takes.

A count of operations, not measured time. The curves that leave the top go past 100.
Operations at n = 10
ClassOperations
O(1)1
O(log n)3.3
O(n)10
O(n log n)33.2
O(n²)100
O(2ⁿ)1,024
O(n!)3,628,800

fig. 03 · grading

Four languages to code in, two to learn in

Pick the language you know, or the one you want to practise. The editor starts you off with a few lines that read the input.

def binary_search(a, target):
    low, high = 0, len(a) - 1
    while low <= high:
        mid = (low + high) // 2
        if a[mid] == target:
            return mid
        if a[mid] < target:
            low = mid + 1
        else:
            high = mid - 1
    return -1

Example run

  • Test 1passed
  • Test 2passed
  • 4 hidden testspassed

Passed6 of 6 tests48 ms

The search loop at the heart of the lesson's problem, and a fixed example of a graded run. Nothing is sent from this page: you write and submit the whole program on the lesson's page.

Lessons, visualizations, problems and messages are all in English and Arabic. The Arabic keeps technical terms in English, the way they're used in class. Switch language from the header at any time; code you've typed stays in the editor.