Skip to content
Embercode
✕
StringsQuick quiz

Prefix function and Z-function

8 questions. Covers Z-function.

Questions 1 to 5 of 8

  1. 1. The prefix function of abacaba is one of the lists below. Which one is correct?
  2. 2. A teammate says: "The prefix function loop is linear, because each outer step runs the while loop at most once." Which correction is the strongest?
  3. 3. Which statements about the prefix array pi and the Z-array z are true? Select all that apply.

    Pick every answer that is true.

  4. 4. What value must z[0] have before the main loop starts, for a string of length n? Write it as a formula.

    Type your answer.

  5. 5. The string is abacaba. How many proper borders does the whole string have? Count every border, not only the longest one.

    Type a number.

5 question(s) left on this page.

Typed answers ignore extra spaces and, for most questions, capital letters.