Skip to content

Brute-force search

words

Level 1 of 3

Also called Naive string search.

Finds every place a pattern stands in a text by trying them all. The pattern starts under the text's first letter and its letters are compared from the left until one differs; then it moves on one place and starts again.

the text, with the pattern under it

letters matched at each place the pattern can stand

letters compared
0

step 1 of 1

Examples

A text of 2 to 10 letters, then a pattern of 1 to 6 letters, a to z only, separated by a comma or a space, for example banana, ana.