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 3 of 22
Question 1 of 14
Step 3 of 22
Step 4 of 22
Step 5 of 22
Step 6 of 22
Step 7 of 22
Step 8 of 22
Step 9 of 22
Step 10 of 22
Question 1 of 14
Question 1 of 14
Right.
You guessed: 60 is smaller than 70, so go left.
What the run did:
60 is smaller than 70, so go left.
Question 1 of 14
Not this time.
You guessed: 60 is bigger than 70, so go right.
What the run did:
60 is smaller than 70, so go left.
Question 2 of 14
Question 2 of 14
Right.
You guessed: Hang 60 to the left of 70.
What the run did:
The way runs out, so hang 60 to the left of 70.
Question 2 of 14
Not this time.
You guessed: Hang 60 to the right of 70.
What the run did:
The way runs out, so hang 60 to the left of 70.
Question 3 of 14
Question 3 of 14
Right.
You guessed: At 70, the two sides differ by one level at most.
What the run did:
At 70, the left side is one level high and the right side empty, so it is balanced.
Question 3 of 14
Not this time.
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 one level high and the right side empty, so it is balanced.
Question 4 of 14
Question 4 of 14
Right.
You guessed: 50 is smaller than 70, so go left.
What the run did:
50 is smaller than 70, so go left.
Question 4 of 14
Not this time.
You guessed: 50 is bigger than 70, so go right.
What the run did:
50 is smaller than 70, so go left.
Question 5 of 14
Question 5 of 14
Right.
You guessed: 50 is smaller than 60, so go left.
What the run did:
50 is smaller than 60, so go left.
Question 5 of 14
Not this time.
You guessed: 50 is bigger than 60, so go right.
What the run did:
50 is smaller than 60, so go left.
Question 6 of 14
Question 6 of 14
Right.
You guessed: Hang 50 to the left of 60.
What the run did:
The way runs out, so hang 50 to the left of 60.
Question 6 of 14
Not this time.
You guessed: Hang 50 to the right of 60.
What the run did:
The way runs out, so hang 50 to the left of 60.