guess the next step: AVL tree
Before each step plays, guess what it does. The page then shows the step as the run takes it and says why, the same sentence the watch page says there.
Step 3 of 45
Question 1 of 36
Step 3 of 45
Step 4 of 45
Step 5 of 45
Step 6 of 45
Step 7 of 45
Step 8 of 45
Step 9 of 45
Step 10 of 45
Question 1 of 36
Question 1 of 36
Not this time.
You guessed: 20 is smaller than 10, so go left.
What the run did:
20 is bigger than 10, so go right.
Question 1 of 36
Right.
You guessed: 20 is bigger than 10, so go right.
What the run did:
20 is bigger than 10, so go right.
Question 2 of 36
Question 2 of 36
Not this time.
You guessed: Hang 20 to the left of 10.
What the run did:
The way runs out, so hang 20 to the right of 10.
Question 2 of 36
Right.
You guessed: Hang 20 to the right of 10.
What the run did:
The way runs out, so hang 20 to the right of 10.
Question 3 of 36
Question 3 of 36
Right.
You guessed: At 10, the two sides differ by one level at most.
What the run did:
At 10, the left side is empty and the right side one level high, so it is balanced.
Question 3 of 36
Not this time.
You guessed: At 10, one side is two levels higher, so the tree must turn.
What the run did:
At 10, the left side is empty and the right side one level high, so it is balanced.
Question 4 of 36
Question 4 of 36
Not this time.
You guessed: 30 is smaller than 10, so go left.
What the run did:
30 is bigger than 10, so go right.
Question 4 of 36
Right.
You guessed: 30 is bigger than 10, so go right.
What the run did:
30 is bigger than 10, so go right.
Question 5 of 36
Question 5 of 36
Not this time.
You guessed: 30 is smaller than 20, so go left.
What the run did:
30 is bigger than 20, so go right.
Question 5 of 36
Right.
You guessed: 30 is bigger than 20, so go right.
What the run did:
30 is bigger than 20, so go right.
Question 6 of 36
Question 6 of 36
Not this time.
You guessed: Hang 30 to the left of 20.
What the run did:
The way runs out, so hang 30 to the right of 20.
Question 6 of 36
Right.
You guessed: Hang 30 to the right of 20.
What the run did:
The way runs out, so hang 30 to the right of 20.