Module IV String Matching Algorithms and Approximation Algorithms 4th Module Assessment 28-30
Module IV String Matching Algorithms and Approximation Algorithms 4th Module Assessment 28-30
/ #Module IV String Matching Algorithms and Approximation Algorithms / 4th Module Assessment
Question 1
Which of the following algorithms is commonly used for exact string matching?
a. Boyer-Moore algorithm
b. Rabin-Karp algorithm
c. Knouth Morris Prat algorithm
d. Levenshtein algorithm
Clear my choice
Question 2
a. 13
b. 14
c. 11
d. 12
Clear my choice
https://amigo.amityonline.com/mod/quiz/attempt.php?attempt=9633251&cmid=142452 1/6
29/05/2024, 23:20 4th Module Assessment
Question 3
Which algorithm is used for approximate string matching, allowing for small differences in the matching pattern?
a. Rabin-Karp algorithm
b. Levenshtein algorithm
c. Boyer-Moore algorithm
d. Knuth-Morris-Pratt algorithm
Clear my choice
Question 4
a. Hashing
b. Sorting
c. Augmenting
d. Dynamic Programming
Clear my choice
Question 5
a. Complexity increases
b. Spurious hits occur frequently
c. Cost of extra checking is low
d. Matching time increases
Clear my choice
https://amigo.amityonline.com/mod/quiz/attempt.php?attempt=9633251&cmid=142452 2/6
29/05/2024, 23:20 4th Module Assessment
Question 6
a. Dynamic programming
b. Hashing
c. Divide and conquer
d. Greedy algorithm
Clear my choice
Question 7
What is the worst case time complexity of KMP algorithm for pattern searching (m = length of text, n = length of
pattern)?
a. O(n)
b. O(n*m)
c. O(m)
d. O(log n)
Clear my choice
Question 8
Which of the following techniques can be used to approximate the string matching problem efficiently?
a. Dynamic programming
b. Greedy algorithm
c. Heuristic algorithms
d. Binary search
Clear my choice
https://amigo.amityonline.com/mod/quiz/attempt.php?attempt=9633251&cmid=142452 3/6
29/05/2024, 23:20 4th Module Assessment
Question 9
Which algorithm is known for its preprocessing phase involving building a suffix array?
a. Rabin-Karp algorithm
b. Levenshtein algorithm
c. Boyer-Moore algorithm
d. Knuth-Morris-Pratt algorithm
Clear my choice
Question 10
The Smith-Waterman algorithm is commonly used for which type of string matching?
Question 11
https://amigo.amityonline.com/mod/quiz/attempt.php?attempt=9633251&cmid=142452 4/6
29/05/2024, 23:20 4th Module Assessment
Question 12
a. O(N+M)
b. O(N×M)
c. O(NM)
d. None of these
Clear my choice
Question 13
Question 14
a. Complexity increases
b. Spurious hits occur frequently
c. Cost of extra checking is low
d. Matching time increases
Clear my choice
https://amigo.amityonline.com/mod/quiz/attempt.php?attempt=9633251&cmid=142452 5/6
29/05/2024, 23:20 4th Module Assessment
Question 15
a. π={0,0,1,1,0,1,2,0,1,2,0,1,2,3,4,5,6,7,8}
b. π={0,0,1,0,0,1,2,0,1,2,0,1,2,3,4,5,6,7,8}
c. π={0,0,1,2,1,1,2,0,1,2,0,1,2,3,4,5,6,7,8}
d. π={0,0,1,2,0,1,2,0,1,2,0,1,2,3,4,5,6,7,8}
Question 16
Given a pattern of length- 5 window, find the spurious hit in the given text string. Pattern: 3 1 4 1 5 Modulus: 13 Index: 0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Text: 2 3 5 9 0 2 3 1 4 1 5 2 6 7 3 9 9 2 1 3 9
a. 6 to 10
b. 6 to 10
c. 13 to 17
d. 3 to 8
Question 17
Working modulo q = 11, how many spurious hits does the Rabin-Karp matcher encounter in the text T =
3141592653589793 when looking for the pattern P = 26?
a. 4
b. 5
c. 6
d. 7
Jump to...
https://amigo.amityonline.com/mod/quiz/attempt.php?attempt=9633251&cmid=142452 6/6