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 31 of 45
Question 25 of 36
Step 31 of 45
Step 32 of 45
Step 33 of 45
Step 34 of 45
Step 35 of 45
Step 36 of 45
Step 37 of 45
Step 38 of 45
Question 25 of 36
Question 25 of 36
Not this time.
You guessed: Hang 60 to the left of 50.
What the run did:
The way runs out, so hang 60 to the right of 50.
Question 25 of 36
Right.
You guessed: Hang 60 to the right of 50.
What the run did:
The way runs out, so hang 60 to the right of 50.
Question 26 of 36
Question 26 of 36
Right.
You guessed: At 50, the two sides differ by one level at most.
What the run did:
At 50, the left side is empty and the right side one level high, so it is balanced.
Question 26 of 36
Not this time.
You guessed: At 50, one side is two levels higher, so the tree must turn.
What the run did:
At 50, the left side is empty and the right side one level high, so it is balanced.
Question 27 of 36
Question 27 of 36
Right.
You guessed: At 40, the two sides differ by one level at most.
What the run did:
At 40, the left side is one level high and the right side 2 levels high, so it is balanced.
Question 27 of 36
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 one level high and the right side 2 levels high, so it is balanced.
Question 28 of 36
Question 28 of 36
Not this time.
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 3 levels high: two levels apart, so the tree must turn.
Question 28 of 36
Right.
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 3 levels high: two levels apart, so the tree must turn.
Question 29 of 36
Question 29 of 36
Right.
You guessed: Turn left at 20.
What the run did:
Turn left at 20: 40 moves up into its place, and 20 hangs to its left.
Question 29 of 36
Not this time.
You guessed: Turn right at 20.
What the run did:
Turn left at 20: 40 moves up into its place, and 20 hangs to its left.
Question 30 of 36
Question 30 of 36
Not this time.
You guessed: 70 is smaller than 40, so go left.
What the run did:
70 is bigger than 40, so go right.
Question 30 of 36
Right.
You guessed: 70 is bigger than 40, so go right.
What the run did:
70 is bigger than 40, so go right.