

MCQOPTIONS
Saved Bookmarks
This section includes 14 Mcqs, each offering curated multiple-choice questions to sharpen your Data Structures and Algorithms knowledge and support exam preparation. Choose a topic below to get started.
1. |
If the expected number of valid shifts is small and modulus is larger than the length of pattern what is the matching time of Rabin Karp Algorithm? |
A. | Theta(m) |
B. | Big-Oh(n+m) |
C. | Theta(n-m) |
D. | Big-Oh(n) |
Answer» C. Theta(n-m) | |
2. |
What is the basic formula applied in Rabin Karp Algorithm to get the computation time as Theta(m)? |
A. | Halving rule |
B. | Horner's rule |
C. | Summation lemma |
D. | Cancellation lemma |
Answer» B. Horner's rule | |
3. |
What happens when the modulo value(q) is taken large? |
A. | Complexity increases |
B. | Spurious hits occur frequently |
C. | Cost of extra checking is low |
D. | Matching time increases |
Answer» D. Matching time increases | |
4. |
Rabin Karp Algorithm makes use of elementary number theoretic notions. |
A. | True |
B. | False |
Answer» B. False | |
5. |
What is a Rabin and Karp Algorithm? |
A. | String Matching Algorithm |
B. | Shortest Path Algorithm |
C. | Minimum spanning tree Algorithm |
D. | Approximation Algorithm |
Answer» B. Shortest Path Algorithm | |
6. |
Which of the following is the fastest algorithm in string matching field? |
A. | Boyer-Moore's algorithm |
B. | String matching algorithm |
C. | Quick search algorithm |
D. | Linear search algorithm |
Answer» D. Linear search algorithm | |
7. |
Which of the following algorithms formed the basis for the Quick search algorithm? |
A. | Boyer-Moore's algorithm |
B. | Parallel string matching algorithm |
C. | Binary Search algorithm |
D. | Linear Search algorithm |
Answer» B. Parallel string matching algorithm | |
8. |
What is the pre-processing time of Rabin and Karp Algorithm? |
A. | Theta(m2) |
B. | Theta(mlogn) |
C. | Theta(m) |
D. | Big-Oh(n) |
Answer» D. Big-Oh(n) | |
9. |
What character shift tables does quick search algorithm use? |
A. | good-character shift tables |
B. | bad-character shift tables |
C. | next-character shift tables |
D. | both good and bad character shift tables |
Answer» C. next-character shift tables | |
10. |
What is the worst case running time of Rabin Karp Algorithm? |
A. | Theta(n) |
B. | Theta(n-m) |
C. | Theta((n-m+1)m) |
D. | Theta(nlogm) |
Answer» D. Theta(nlogm) | |
11. |
What is the time complexity of the Quick search algorithm? |
A. | O(n) |
B. | O(log n) |
C. | O(m+n) |
D. | O(mn) |
Answer» D. O(mn) | |
12. |
Rabin- Karp algorithm can be used for discovering plagiarism in a sentence. |
A. | True |
B. | False |
Answer» B. False | |
13. |
What is the running time of Boyer-Moore's algorithm? |
A. | O(n) |
B. | O(log n) |
C. | O(m+n) |
D. | O(mn) |
Answer» E. | |
14. |
What character shift tables does Boyer-Moore's search algorithm use? |
A. | good-character shift tables |
B. | bad-character shift tables |
C. | next-character shift tables |
D. | both good and bad character shift tables |
Answer» E. | |