Welcome and warm-up
After this: See what the tutorial covers, and warm up with three small questions.
On this page · 3 sections · 3 checks
Welcome. This tutorial is about the hash map, a way of storing information so that you can find any piece of it again almost at once. Python's dict and Java's HashMap are both hash maps. If you have used one of them, you will now see how it works inside. If you have never used one, that is fine too: the next lesson starts from the very beginning.
By the end you will have built a small working hash map piece by piece, and you will have watched every operation happen step by step.
The whole tutorial takes about two and a half hours. You can split it into as many sittings as you like, and your progress stays in this browser.
What you need
You need to be able to read a few lines of Python or Java, with lists, loops and functions. Nothing else is assumed. The lessons explain every new word when it first appears.
Three warm-up questions
These questions are not a test, and nothing is locked behind them. They use the same small skills as the lessons: reading a list by position, following a loop, and following a function call. If one of them surprises you, read the explanation and continue.
Pick the output of each program. The switch on each code block shows the Python or Java version, and the answers are the same in both.
What does this print?
scores = [10, 20, 30]print(scores[1])int[] scores = {10, 20, 30};System.out.println(scores[1]);What does this print?
total = 0for n in [1, 2, 3, 4]: total += nprint(total)int total = 0;for (int n : new int[] {1, 2, 3, 4}) { total += n;}System.out.println(total);What does this print?
def double(x): return x * 2
print(double(3) + 1)static int doubleIt(int x) { return x * 2;}
System.out.println(doubleIt(3) + 1);How the lessons work
- One idea per lesson. You read a little, watch it happen, then check yourself.
- The visualizer shows every step. It is a moving picture of a hash map. Each operation plays as numbered steps that you can pause and replay.
- Checks explain themselves. Every option says why it is right or wrong. Hints are there when you want them, and you can try as many times as you like.
- Honesty notes show where the small model in these lessons differs from the real
dictorHashMap.
- Know what the tutorial covers and how long it takes.
- Read a list by position, a loop total and a function call.