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.
Prefix function values
Difficulty 1
No attempts yet
What is the longest border length f(j) of the prefix 01100[1..5] of 01100?
Difficulty 2
No attempts yet
What is the longest border length f(j) of the prefix 11100111[1..4] of 11100111?
Difficulty 3
No attempts yet
What is the longest border length f(j) of the prefix 01001100000[1..3] of 01001100000?
Difficulty 4
No attempts yet
What is the longest border length f(j) of the prefix 10010101101000[1..4] of 10010101101000?
Count the borders of a prefix
Difficulty 1
No attempts yet
How many nonempty borders does the prefix 110[1..3] of 110 have?
Difficulty 2
No attempts yet
How many nonempty borders does the prefix 101110[1..6] of 101110 have?
Difficulty 3
No attempts yet
How many nonempty borders does the prefix 0110101010[1..1] of 0110101010 have?
Difficulty 4
No attempts yet
How many nonempty borders does the prefix 010111101110010[1..9] of 010111101110010 have?
Find occurrences
Difficulty 1
No attempts yet
Find all starting positions of 00 in 10000.
Difficulty 2
No attempts yet
Find all starting positions of 01 in 00000000.
Difficulty 3
No attempts yet
Find all starting positions of 1100 in 11010000000011.
Difficulty 4
No attempts yet
Find all starting positions of 101000 in 10010000111110011010100.