Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Find Median from Data Stream

HardLeetCode 295 ↗

The problem, in one line. Numbers arrive one at a time, and at any moment you must report the median of everything seen so far. LeetCode 295.

The tell. The middle of a growing collection. You never need the whole order, only the two values at the seam between the smaller half and the larger half, and each half needs only one end of itself: the biggest of the small half and the smallest of the big half. The lesson is Two heaps and a merge (running median, k-way merge, top-k).

Included with a plan

This solution is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.