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 10 of 22
Question 7 of 14
Step 10 of 22
Step 11 of 22
Step 12 of 22
Step 13 of 22
Step 16 of 22
Step 17 of 22
Step 18 of 22
Step 19 of 22
Question 7 of 14
Question 7 of 14
Right.
You guessed: At 60, the two sides differ by one level at most.
What the run did:
At 60, the left side is one level high and the right side empty, so it is balanced.
Question 7 of 14
Not this time.
You guessed: At 60, one side is two levels higher, so the tree must turn.
What the run did:
At 60, the left side is one level high and the right side empty, so it is balanced.
Question 8 of 14
Question 8 of 14
Not this time.
You guessed: At 70, the two sides differ by one level at most.
What the run did:
At 70, the left side is 2 levels high and the right side empty: two levels apart, so the tree must turn.
Question 8 of 14
Right.
You guessed: At 70, one side is two levels higher, so the tree must turn.
What the run did:
At 70, the left side is 2 levels high and the right side empty: two levels apart, so the tree must turn.
Question 9 of 14
Question 9 of 14
Not this time.
You guessed: Turn left at 70.
What the run did:
Turn right at 70: 60 moves up into its place, and 70 hangs to its right.
Question 9 of 14
Right.
You guessed: Turn right at 70.
What the run did:
Turn right at 70: 60 moves up into its place, and 70 hangs to its right.
Question 10 of 14
Question 10 of 14
Right.
You guessed: 40 is smaller than 60, so go left.
What the run did:
40 is smaller than 60, so go left.
Question 10 of 14
Not this time.
You guessed: 40 is bigger than 60, so go right.
What the run did:
40 is smaller than 60, so go left.
Question 11 of 14
Question 11 of 14
Right.
You guessed: 40 is smaller than 50, so go left.
What the run did:
40 is smaller than 50, so go left.
Question 11 of 14
Not this time.
You guessed: 40 is bigger than 50, so go right.
What the run did:
40 is smaller than 50, so go left.
Question 12 of 14
Question 12 of 14
Right.
You guessed: Hang 40 to the left of 50.
What the run did:
The way runs out, so hang 40 to the left of 50.
Question 12 of 14
Not this time.
You guessed: Hang 40 to the right of 50.
What the run did:
The way runs out, so hang 40 to the left of 50.