31. What is the worst-case time complexity of the Boyer-Moore algorithm? A. O(m + n) B. O(m log n) C. O(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
32. In the Rabin-Karp algorithm, which operation is used to compute hash values? A. Rolling Hash B. Modulo Operation C. Multiplication D. Addition 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
33. What is the main disadvantage of the Naive string matching algorithm? A. It is complex to implement. B. It requires the text to be sorted. C. It cannot handle patterns with special characters. D. It can be slow for large texts. 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
34. Which of the following string matching algorithms uses a "shift" table to skip unnecessary comparisons? A. Knuth-Morris-Pratt (KMP) B. Rabin-Karp C. Boyer-Moore D. Naive Search 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
35. How does the Knuth-Morris-Pratt (KMP) algorithm handle mismatches efficiently? A. By sorting the text. B. By using the failure function. C. By using a sliding window. D. By sorting the text. 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
36. What is the primary purpose of the "bad character rule" in the Boyer-Moore algorithm? A. To skip segments of the text based on mismatched characters. B. To preprocess the pattern. C. To hash the pattern. D. To sort the pattern. 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
37. Which string matching algorithm is particularly useful for finding multiple patterns in a single pass? A. Naive Search B. Boyer-Moore C. Knuth-Morris-Pratt (KMP) D. Rabin-Karp 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
38. What is the worst-case time complexity of the Rabin-Karp algorithm when dealing with multiple patterns? A. O(m + n) B. O(m*n) C. O(mnk) 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
39. In the context of string matching, what does the term "partial match table" refer to? A. The array used for storing results. B. The data structure used in KMP algorithm. C. The table used to track character shifts. D. The array used for storing results. 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
40. What is a significant advantage of the Rabin-Karp algorithm over other string matching algorithms? A. It is the fastest for short texts. B. It does not require preprocessing. C. It allows for efficient multiple pattern matching. D. It always performs in linear time. 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