0% found this document useful (0 votes)
3 views6 pages

Module IV String Matching Algorithms and Approximation Algorithms 4th Module Assessment 28-30

The document contains a 4th module assessment for a course on Data Structures and Algorithm Design, focusing on string matching algorithms and approximation algorithms. It includes multiple-choice questions related to various algorithms such as Boyer-Moore, Rabin-Karp, and Knuth-Morris-Pratt, along with questions on their principles, complexities, and applications. The assessment is designed to test knowledge on exact and approximate string matching techniques.

Uploaded by

brucelee565001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views6 pages

Module IV String Matching Algorithms and Approximation Algorithms 4th Module Assessment 28-30

The document contains a 4th module assessment for a course on Data Structures and Algorithm Design, focusing on string matching algorithms and approximation algorithms. It includes multiple-choice questions related to various algorithms such as Boyer-Moore, Rabin-Karp, and Knuth-Morris-Pratt, along with questions on their principles, complexities, and applications. The assessment is designed to test knowledge on exact and approximate string matching techniques.

Uploaded by

brucelee565001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

29/05/2024, 23:20 4th Module Assessment

Dashboard / My courses / Data Structures and Algorithm Design (CSE601)-Semester II

/ #Module IV String Matching Algorithms and Approximation Algorithms / 4th Module Assessment

Question 1

Not yet answered

Marked out of 1.00

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

Not yet answered

Marked out of 1.00

Given a pattern of length-5 window, find the suitable modulo value. 4 3 2 5 0

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

Not yet answered

Marked out of 1.00

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

Not yet answered

Marked out of 1.00

What is the basic principle in Rabin Karp algorithm?

a. Hashing
b. Sorting
c. Augmenting
d. Dynamic Programming
Clear my choice

Question 5

Not yet answered

Marked out of 1.00

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
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

Not yet answered

Marked out of 1.00

The Rabin-Karp algorithm is based on which concept?

a. Dynamic programming
b. Hashing
c. Divide and conquer
d. Greedy algorithm
Clear my choice

Question 7

Not yet answered

Marked out of 1.00

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

Not yet answered

Marked out of 1.00

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

Not yet answered

Marked out of 1.00

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

Not yet answered

Marked out of 1.00

The Smith-Waterman algorithm is commonly used for which type of string matching?

a. Exact string matching


b. Approximate string matching
c. Subsequence matching
d. Suffix matching
Clear my choice

Question 11

Not yet answered

Marked out of 2.00

How is KMP better than the brute-force approach?

a. By comparing the characters right to left instead of left to right.


b. By searching for text in pattern instead of pattern in string
c. By not doing redundant comparisons and using the information gained from previous comparisons
d. None of the above
Clear my choice

https://amigo.amityonline.com/mod/quiz/attempt.php?attempt=9633251&cmid=142452 4/6
29/05/2024, 23:20 4th Module Assessment

Question 12

Not yet answered

Marked out of 2.00

What is the Naive String Searching Algorithm's temporal complexity?

a. O(N+M)
b. O(N×M)
c. O(NM)
d. None of these
Clear my choice

Question 13

Not yet answered

Marked out of 2.00

Which of the following statements is accurate for KMP String searching?

a. The value of strInd always increases in all iterations.


b. The value of strInd remains same in all the iterations.
c. The value of strInd may or may not increase in all the iterations but it never decreases.
d. None of the above
Clear my choice

Question 14

Not yet answered

Marked out of 2.00

What happens if q is treated as a large modulo value?

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

Not yet answered

Marked out of 4.00

Compute the prefix function for the pattern ababbabbabbababbabb

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

Not yet answered

Marked out of 4.00

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

Not yet answered

Marked out of 4.00

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

◄ Test Your Understanding : 4.2.4 The Subset-sum Problem

Jump to...

Module 4 Feedback Form ►

https://amigo.amityonline.com/mod/quiz/attempt.php?attempt=9633251&cmid=142452 6/6

You might also like