21. Which string matching algorithm is known for its use of multiple pattern matching in a single pass? A. Boyer-Moore B. Rabin-Karp C. Naive Search D. Boyer-Moore Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
22. What does the failure function in the Knuth-Morris-Pratt (KMP) algorithm help with? A. Preprocessing the text. B. Sorting the pattern. C. Determining the next position to match after a mismatch. D. Hashing the pattern. Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
23. What is the best-case time complexity of the Rabin-Karp algorithm? A. O(n) B. O(m) C. O(m*n) D. O(m + n) Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
24. Which algorithm is particularly well-suited for string matching when the pattern is very short? A. Knuth-Morris-Pratt (KMP) B. Rabin-Karp C. Naive Search D. Boyer-Moore Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
25. Which string matching algorithm performs well with patterns that have repeating substrings? A. Boyer-Moore B. Rabin-Karp C. Naive Search D. Knuth-Morris-Pratt (KMP) Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
26. In which scenario is the Naive string matching algorithm the least efficient? A. When the pattern and text are very long. B. When the pattern is very short. C. When the text is sorted. D. When there are many matches in the text. Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
27. Which string matching algorithm is based on the concept of skipping over parts of the text that cannot possibly match? A. Naive Search B. Rabin-Karp C. Knuth-Morris-Pratt (KMP) D. Boyer-Moore Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
28. What is the role of the "good suffix" rule in the Boyer-Moore algorithm? A. To calculate hash values. B. To match patterns with multiple lengths. C. To optimize the search by skipping unnecessary comparisons. D. To preprocess the pattern. Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
29. Which string matching algorithm is the most suitable for real-time systems where speed is crucial? A. Rabin-Karp B. Boyer-Moore C. Naive Search D. Rabin-Karp Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
30. What is the primary advantage of the Boyer-Moore algorithm compared to the Naive Search algorithm? A. It always performs well regardless of pattern length. B. It works well for very short patterns. C. It skips large portions of the text, making it faster for large datasets. D. It uses less memory. Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board