Algorithms · Lesson 7 · Practice

Practice: KMP and the Prefix Function

Every quiz type from this lesson. Start at difficulty 1 and work up; correct answers build your streak, and after a few attempts this page points you at your weakest quiz.

Difficulty

Prefix function values

Difficulty 1

No attempts yet

What is the longest border length f(j) of the prefix 01100[1..5] of 01100?

Count the borders of a prefix

Difficulty 1

No attempts yet

How many nonempty borders does the prefix 110[1..3] of 110 have?

Find occurrences

Difficulty 1

No attempts yet

Find all starting positions of 00 in 10000.