1. Which string matching algorithm is known for its preprocessing phase to create a partial match table? A. Naive Search B. Rabin-Karp C. Boyer-Moore 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
2. What is the time complexity of the Boyer-Moore string matching algorithm in the best case? A. O(m + n) B. O(n) C. O(m/n) D. O(m log n) 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
3. Which string matching algorithm uses hashing to achieve its results? 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
4. In which scenario does the Naive string matching algorithm perform well? A. When using a large alphabet. B. When there are many potential matches. C. When both the pattern and text are very short. D. When the pattern is long and the text is large. 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
5. What is the worst-case time complexity of the Rabin-Karp algorithm? A. O(m + n) B. O(m*n) C. O(m + n*log 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
6. What is the main advantage of the Boyer-Moore algorithm over others? A. It skips sections of the text that cannot match. B. It requires less preprocessing time. C. It uses less memory. D. It can handle multiple patterns efficiently. 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
7. Which string matching algorithm is typically used in text editors for search functionality? 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
8. What is the space complexity of the Knuth-Morris-Pratt (KMP) algorithm? A. O(n) B. O(m + n) C. O(m) D. O(m*n) 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
9. Which of the following algorithms is based on the principle of hashing for pattern matching? 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
10. What is the average-case time complexity of the Boyer-Moore algorithm? A. O(m*n) B. O(m) C. O(m + n) D. O(n) 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