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 17 of 45
Question 13 of 36
Step 17 of 45
Step 18 of 45
Step 19 of 45
Step 20 of 45
Step 21 of 45
Step 22 of 45
Step 23 of 45
Step 24 of 45
Question 13 of 36
Question 13 of 36
Right.
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 one level high, so it is balanced.
Question 13 of 36
Not this time.
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 one level high, so it is balanced.
Question 14 of 36
Question 14 of 36
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 2 levels high, so it is balanced.
Question 14 of 36
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 2 levels high, so it is balanced.
Question 15 of 36
Question 15 of 36
Not this time.
You guessed: 50 is smaller than 20, so go left.
What the run did:
50 is bigger than 20, so go right.
Question 15 of 36
Right.
You guessed: 50 is bigger than 20, so go right.
What the run did:
50 is bigger than 20, so go right.
Question 16 of 36
Question 16 of 36
Not this time.
You guessed: 50 is smaller than 30, so go left.
What the run did:
50 is bigger than 30, so go right.
Question 16 of 36
Right.
You guessed: 50 is bigger than 30, so go right.
What the run did:
50 is bigger than 30, so go right.
Question 17 of 36
Question 17 of 36
Not this time.
You guessed: 50 is smaller than 40, so go left.
What the run did:
50 is bigger than 40, so go right.
Question 17 of 36
Right.
You guessed: 50 is bigger than 40, so go right.
What the run did:
50 is bigger than 40, so go right.
Question 18 of 36
Question 18 of 36
Not this time.
You guessed: Hang 50 to the left of 40.
What the run did:
The way runs out, so hang 50 to the right of 40.
Question 18 of 36
Right.
You guessed: Hang 50 to the right of 40.
What the run did:
The way runs out, so hang 50 to the right of 40.