Question

The Naive Pattern Searching algorithm has a worst-case time complexity of O(M

  • N , where 'M' is the length of the pattern and 'N' is the length of the text. This occurs when:
A The pattern is very short.
B The pattern is very long.
C All characters in the text and pattern are distinct.
D Many characters match before a mismatch, but the pattern shifts only by one.
E The pattern is not found in the text.
Practice Next

Hey! Ask a query

🎓
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
  • 200 Questions with Detailed Solutions
  • Section-wise Coverage (GA, English, Quant & Reasoning)