Computer Science EngineeringVery hard

For the pattern ABABACA, the KMP longest-proper-prefix-which-is-also-suffix value at the last position is

  1. A. 0
  2. B. 1
  3. C. 2
  4. D. 3

Correct answer: B. 1

The whole pattern ends in A and the longest proper border is the single letter A, so the value is 1.

More Algorithms, Data Structures & Programming (ISRO CS) questions

Exams that ask this topic