Q. What is the worst case time complexity of KMP algorithm for pattern searching (m = length of text, n = length of pattern)?

  • (A) o(n)
  • (B) o(n*m)
  • (C) o(m)
  • (D) o(log n)
πŸ’¬ Discuss
βœ… Correct Answer: (C) o(m)
Explanation: kmp algorithm is an efficient pattern searching algorithm. it has a time complexity of o(m) where m is the length of text.

Explanation by: Mr. Dubey
kmp algorithm is an efficient pattern searching algorithm. it has a time complexity of o(m) where m is the length of text.

πŸ’¬ Discussion

πŸ“Š Question Analytics

πŸ‘οΈ
941
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
92%
Success Rate