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 19 of 35
Question 13 of 27
Step 19 of 35
Step 20 of 35
Step 21 of 35
Step 22 of 35
Step 23 of 35
Step 24 of 35
Step 25 of 35
Question 13 of 27
Question 13 of 27
Right.
You guessed: Another letter is compared here, and it matches the pattern's.
What the run did:
The text's a at position 4 matches the pattern's a.
Question 13 of 27
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 4 matches the pattern's a.
Question 13 of 27
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 4 matches the pattern's a.
Question 14 of 27
Question 14 of 27
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 14 of 27
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 14 of 27
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 15 of 27
Question 15 of 27
Not this time.
You guessed: Another letter is compared here, and it matches the pattern's.
What the run did:
The text's a at position 6 is not the pattern's b.
Question 15 of 27
Right.
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 is not the pattern's b.
Question 15 of 27
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 is not the pattern's b.
Question 16 of 27
Question 16 of 27
Right.
You guessed: Some letters matched, so line the pattern up by their border.
What the run did:
5 letters matched. They end with a border 4 long, so move the pattern on to place 2, where that border stands under them, and carry on at the same text letter.
Question 16 of 27
Not this time.
You guessed: Nothing matched here, so move the pattern on past this letter.
What the run did:
5 letters matched. They end with a border 4 long, so move the pattern on to place 2, where that border stands under them, and carry on at the same text letter.
Question 17 of 27
Question 17 of 27
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 17 of 27
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 17 of 27
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.
Question 18 of 27
Question 18 of 27
Not this time.
You guessed: Another letter is compared here, and it matches the pattern's.
What the run did:
The text's a at position 7 is not the pattern's b.
Question 18 of 27
Right.
You guessed: Another letter is compared here, and it is not the pattern's.
What the run did:
The text's a at position 7 is not the pattern's b.
Question 18 of 27
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 7 is not the pattern's b.