1.

What is the worst case running time in searching phase of Boyer-Moore’s algorithm?(a) O(n)(b) O(log n)(c) O(m+n)(d) O(mn)The question was posed to me during an interview for a job.My question is based upon String Matching topic in chapter String Matching of Data Structures & Algorithms II

Answer» CORRECT option is (d) O(MN)

The explanation is: If the pattern OCCURS in the text, the worst case running time of Boyer-Moore’s ALGORITHM is found to be O(mn).


Discussion

No Comment Found

Related InterviewSolutions