guess the next step: Knuth-Morris-Pratt
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 11 of 19
Question 7 of 13
Step 11 of 19
Step 12 of 19
Step 13 of 19
Step 14 of 19
Step 15 of 19
Step 16 of 19
Step 17 of 19
Question 7 of 13
Question 7 of 13
Right.
You guessed: Another letter is compared here, and it matches the pattern's.
What the run did:
The text's a at position 3 matches the pattern's a.
Question 7 of 13
Not this time.
You guessed: Another letter is compared here, and it is not the pattern's.
What the run did:
The text's a at position 3 matches the pattern's a.
Question 7 of 13
Not this time.
You guessed: No letter is left to compare, so the pattern stands here.
What the run did:
The text's a at position 3 matches the pattern's a.
Question 8 of 13
Question 8 of 13
Not this time.
You guessed: Another letter is compared here, and it matches the pattern's.
What the run did:
The text's b at position 4 is not the pattern's a.
Question 8 of 13
Right.
You guessed: Another letter is compared here, and it is not the pattern's.
What the run did:
The text's b at position 4 is not the pattern's a.
Question 8 of 13
Not this time.
You guessed: No letter is left to compare, so the pattern stands here.
What the run did:
The text's b at position 4 is not the pattern's a.
Question 9 of 13
Question 9 of 13
Right.
You guessed: Some letters matched, so line the pattern up by their border.
What the run did:
3 letters matched. They end with a border 1 long, so move the pattern on to place 3, where that border stands under them, and carry on at the same text letter.
Question 9 of 13
Not this time.
You guessed: Nothing matched here, so move the pattern on past this letter.
What the run did:
3 letters matched. They end with a border 1 long, so move the pattern on to place 3, where that border stands under them, and carry on at the same text letter.
Question 10 of 13
Question 10 of 13
Right.
You guessed: Another letter is compared here, and it matches the pattern's.
What the run did:
The text's b at position 4 matches the pattern's b.
Question 10 of 13
Not this time.
You guessed: Another letter is compared here, and it is not the pattern's.
What the run did:
The text's b at position 4 matches the pattern's b.
Question 10 of 13
Not this time.
You guessed: No letter is left to compare, so the pattern stands here.
What the run did:
The text's b at position 4 matches the pattern's b.
Question 11 of 13
Question 11 of 13
Right.
You guessed: Another letter is compared here, and it matches the pattern's.
What the run did:
The text's a at position 5 matches the pattern's a.
Question 11 of 13
Not this time.
You guessed: Another letter is compared here, and it is not the pattern's.
What the run did:
The text's a at position 5 matches the pattern's a.
Question 11 of 13
Not this time.
You guessed: No letter is left to compare, so the pattern stands here.
What the run did:
The text's a at position 5 matches the pattern's a.
Question 12 of 13
Question 12 of 13
Right.
You guessed: Another letter is compared here, and it matches the pattern's.
What the run did:
The text's a at position 6 matches the pattern's a.
Question 12 of 13
Not this time.
You guessed: Another letter is compared here, and it is not the pattern's.
What the run did:
The text's a at position 6 matches the pattern's a.
Question 12 of 13
Not this time.
You guessed: No letter is left to compare, so the pattern stands here.
What the run did:
The text's a at position 6 matches the pattern's a.