Question 14
Which of the following option represents the fail function (or prefix function) for pattern 'bonbon' in the Knuth-Morris-Pratt (KMP) algorithm?
[0, 0, 0, 1, 1, 2]
[0, 0, 0, 1, 2, 3]
[0, 0, 1, 2, 3, 3]
[0, 0, 0, 0, 1, 2]
Which of the following option represents the fail function (or prefix function) for pattern 'bonbon' in the Knuth-Morris-Pratt (KMP) algorithm?
[0, 0, 0, 1, 1, 2]
[0, 0, 0, 1, 2, 3]
[0, 0, 1, 2, 3, 3]
[0, 0, 0, 0, 1, 2]
Correct answer
[0, 0, 0, 1, 2, 3]
Question 14 of 30 in the IIT Madras BS Programming, Data Structures and Algorithms using Python (PDSA) End Term paper sat on 3 Apr 2022, in the January 2022 term (IIT M FOUNDATION DIPLOMA ENDTERM FN1 3 Apr 2022). It carries 3 marks.