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 24 of 45
Question 19 of 36
Step 24 of 45
Step 25 of 45
Step 26 of 45
Step 27 of 45
Step 28 of 45
Step 29 of 45
Step 30 of 45
Step 31 of 45
Question 19 of 36
Question 19 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 empty and the right side one level high, so it is balanced.
Question 19 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 empty and the right side one level high, so it is balanced.
Question 20 of 36
Question 20 of 36
Not this time.
You guessed: At 30, the two sides differ by one level at most.
What the run did:
At 30, the left side is empty and the right side 2 levels high: two levels apart, so the tree must turn.
Question 20 of 36
Right.
You guessed: At 30, one side is two levels higher, so the tree must turn.
What the run did:
At 30, the left side is empty and the right side 2 levels high: two levels apart, so the tree must turn.
Question 21 of 36
Question 21 of 36
Right.
You guessed: Turn left at 30.
What the run did:
Turn left at 30: 40 moves up into its place, and 30 hangs to its left.
Question 21 of 36
Not this time.
You guessed: Turn right at 30.
What the run did:
Turn left at 30: 40 moves up into its place, and 30 hangs to its left.
Question 22 of 36
Question 22 of 36
Not this time.
You guessed: 60 is smaller than 20, so go left.
What the run did:
60 is bigger than 20, so go right.
Question 22 of 36
Right.
You guessed: 60 is bigger than 20, so go right.
What the run did:
60 is bigger than 20, so go right.
Question 23 of 36
Question 23 of 36
Not this time.
You guessed: 60 is smaller than 40, so go left.
What the run did:
60 is bigger than 40, so go right.
Question 23 of 36
Right.
You guessed: 60 is bigger than 40, so go right.
What the run did:
60 is bigger than 40, so go right.
Question 24 of 36
Question 24 of 36
Not this time.
You guessed: 60 is smaller than 50, so go left.
What the run did:
60 is bigger than 50, so go right.
Question 24 of 36
Right.
You guessed: 60 is bigger than 50, so go right.
What the run did:
60 is bigger than 50, so go right.