0% found this document useful (0 votes)
23 views

Daa Assignment Unit-5

The document discusses algorithms and data structures. It contains 10 questions related to string matching algorithms like Rabin Karp, Knuth-Morris-Pratt (KMP), naive string matching; approximation algorithms for set cover and vertex cover problems; complexity classes like P, NP, NP-hard, NP-complete; backtracking algorithms for N-queens problem and sum of subsets problem; and dynamic programming algorithms like longest common subsequence (LCS) and Floyd-Warshall.

Uploaded by

Ritik chaudhary
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Daa Assignment Unit-5

The document discusses algorithms and data structures. It contains 10 questions related to string matching algorithms like Rabin Karp, Knuth-Morris-Pratt (KMP), naive string matching; approximation algorithms for set cover and vertex cover problems; complexity classes like P, NP, NP-hard, NP-complete; backtracking algorithms for N-queens problem and sum of subsets problem; and dynamic programming algorithms like longest common subsequence (LCS) and Floyd-Warshall.

Uploaded by

Ritik chaudhary
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

SESSION:2023-24

ABES Engineering College, Ghaziabad


Department of Information Technology

DESIGN AND ANALYSIS OF


ALGORITHM CLASS/SEM:
(KCS 503) B.TechVth (ODD)
UNIT-IV & V

1 Write Rabin Karp string matching algorithm. Working modulo q=11, how many spurious
hits does the Rabin karp matcher in the text T= 3141592653589793, when looking for the
pattern P=26.

2 Explain and Write the Knuth-Morris-Pratt algorithm for pattern matching also write its
time complexity. Perform KMP algorithm to search the occurrence of pattern abaab in
the string abbabaabaabab

3 Explain and Write the Naïve-String string matching algorithm: Suppose the given pattern
p= aab and given text T = a c a a b c. Apply Naïve-String Matching algorithm on above
Pattern (P) and Text (T) to find the number of occurrences of P in T.
4 Explain approximation algorithm. Explore set cover problem using approximation
algorithm.
5 Write and explain the algorithm to solve vertex cover problem using approximation
algorithm
6 Define P, NP, NP hard and NP complete. Give example of each

7. What is N queens problem? Draw a state space tree for 4 queens problem using
backtracking

8 Discuss LCS algorithm to compute Longest Common Subsequence of two given strings
and time complexity analysis with example

9 Write down the Floyd Warshal algorithm and its complexity. Explain with example

10 What is backtracking? Discuss sum of subset problem with the help of an example.

You might also like