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 11 of 35
Question 7 of 26
Step 11 of 35
Step 12 of 35
Step 13 of 35
Step 14 of 35
Step 15 of 35
Step 16 of 35
Step 17 of 35
Step 18 of 35
Question 7 of 26
Question 7 of 26
Right.
You guessed: 10 is smaller than 40, so go left.
What the run did:
10 is smaller than 40, so go left.
Question 7 of 26
Not this time.
You guessed: 10 is bigger than 40, so go right.
What the run did:
10 is smaller than 40, so go left.
Question 8 of 26
Question 8 of 26
Right.
You guessed: 10 is smaller than 20, so go left.
What the run did:
10 is smaller than 20, so go left.
Question 8 of 26
Not this time.
You guessed: 10 is bigger than 20, so go right.
What the run did:
10 is smaller than 20, so go left.
Question 9 of 26
Question 9 of 26
Right.
You guessed: Hang 10 to the left of 20.
What the run did:
The way runs out, so hang 10 to the left of 20.
Question 9 of 26
Not this time.
You guessed: Hang 10 to the right of 20.
What the run did:
The way runs out, so hang 10 to the left of 20.
Question 10 of 26
Question 10 of 26
Right.
You guessed: At 20, the two sides differ by one level at most.
What the run did:
At 20, the left side is one level high and the right side empty, so it is balanced.
Question 10 of 26
Not this time.
You guessed: At 20, one side is two levels higher, so the tree must turn.
What the run did:
At 20, the left side is one level high and the right side empty, so it is balanced.
Question 11 of 26
Question 11 of 26
Right.
You guessed: At 40, the two sides differ by one level at most.
What the run did:
At 40, the left side is 2 levels high and the right side one level high, so it is balanced.
Question 11 of 26
Not this time.
You guessed: At 40, one side is two levels higher, so the tree must turn.
What the run did:
At 40, the left side is 2 levels high and the right side one level high, so it is balanced.
Question 12 of 26
Question 12 of 26
Right.
You guessed: 30 is smaller than 40, so go left.
What the run did:
30 is smaller than 40, so go left.
Question 12 of 26
Not this time.
You guessed: 30 is bigger than 40, so go right.
What the run did:
30 is smaller than 40, so go left.