Update Question Bank(DAA)
Update Question Bank(DAA)
TECH (CSE)
SEMESTER / YEAR: 5TH /3RD
SUBJECT NAME (SUBJECT CODE): DAA/KCS-503
UNIT-I
a) What do you mean algorithms? CO1
UNIT-II
a) What is Red Black tree? CO1
UNIT-III
a) Compare dynamic and greedy programming strategies. CO2
i) Write notes any one: (i) Prim’s algo (ii) Kruskal ‘s algo CO1
UNIT-IV
a) Write application of Dynamic programming. CO1
UNIT-V
a) Write an algorithm for naive string matcher? CO2
SECTION-B & C
Note: 10 questions from each unit as per 10 marks or 5 marks.
UNIT-I
a) Solve the following recurrence relation: CO4
b) Describe Growth of Functions. Explain its types with suitable example. CO3
c) Write Heap sort algorithm. and arrange the no. in increasing order using HEAP Sort CO4
algorithm. 3,6,8,1,4,5,9,7,2
e) Arrange the no. in increasing order using shell sort algorithm. 11,88,22,77,33,66,44,55 CO4
f) Arrange the no. in increasing order using Quick sorting algorithm. 9 ,4 ,10 ,1 ,2 ,4,7.3,8 CO5
g) Write Merge sort algorithm and sort the following sequence {23, 11, 5, 15, 68, 31, 4, 17} CO3
using merge sort.
i) Illustrate the operation of counting sort on the following array: A= {6, 0, 2, 0, 1,3, 4, 6, 1, CO3
3, 2}
j) Describe of Master Method for recurrence problem. CO3
UNIT-II
a) Describe the Fibonacci heap algorithms with example. CO2
b) Write an algorithm for insertion of key in the Red-Black Tree. Discuss the various cases CO5
for insertion of key in red-black tree for given sequence of key in an empty red-black tree-
4,7,12,15,3,5,14,18,16,17.
c) Explain and write an algorithm for union of two binomial heaps and create binomial heap CO4
for 7,2,4,17,1,11,6,8,15.
g) What is skip list? Explain the Search operation in Skip list with suitable CO3
example also write its algorithm.
h) Describe Red-Black tree with explain any example. CO3
l Also show that a red-black tree with n internal nodes has height at most 2 log (n+1).
UNIT-III
a) Define minimum spanning tree (MST). Write Prim’s algorithm to generate a MST for CO4
any given weighted graph. Generate MST for the following graph using Prim’s
algorithm.
c) Explain Dijkstra’s algorithm to solve single source shortest path problem CO3
e) Find optimal solution using 0/1knapsack approach: (V1 V2 V3 V4) = (1,2,5,6) and (W1 W2 CO4
W3 W4) = (2,3,4,5) if maximum limit 8kg.
f) What is single source shortest paths? Write down Dijkstra’s algorithm for it. CO3
g) Discuss greedy approach to an activity selection problem of scheduling several competing CO3
activities. Solve following activity selection problem S = {A1, A2, A3, A4, A5, A6, A7}
Si = {10,5,15,7,6,18,3} Fi = {2,3,5,7,1,4,1}
h) What is Knapsack problem? Solve Fractional knapsack problem using greedy CO2
programming for the following four items with their weights w = {3, 5, 9, 5} and
values P = {45, 30, 45, 10} with knapsack capacity is 16.
i) Write the Bellman Ford Algorithm & find out the shortest path using Bellman Ford CO5
UNIT-IV
a) Explain about Dynamic Programming approach. CO2
b) Explain the Floyd War shall algorithm with example. Which design strategy the algorithm CO2
uses?
d) Discuss n queen’s problem. Solve 4 queen’s problem using backtracking method? CO4
e) What is sum of subset problem? Draw a state space tree for Sum of subset problem using CO2
backtracking? Let n=4, m=8 and w [1:4] = {1,3,4,5}.
f) Explain the method of finding Hamiltonian cycles in a graph using backtracking CO3
method with suitable example.
g) What is the difference between Backtracking a Branch & Bound? CO3
j) Explain TPS with any example using Back Tracking Algorithm. CO2
k) Find the longest common subsequence path from X=<A, B, C, B, D, A, B> and Y=<B, D, CO4
C, A, B, A>.
l What is the sum of subsets problem? Let w= {5,7,10,12,15,18,20} and m=35. Find all CO4
possible subsets of w that sum to m using recursive backtracking algorithm for it. Draw the
portion of the state-space tree that is generated.
UNIT-V
a) Write down the detailed note on Naive string-matching Algorithm. CO4
c) Write KMP algorithm for string matching with complexity? Perform the KMP algorithm CO4
to search the occurrences of the pattern abaab in the text string abbabaabaabab.
d) Write Rabin Karp string matching algorithm. Working modulo q=11, how many spurious CO5
hits does the Rabin Karp matcher in the text T=3141592653589793, when looking for the
pattern P=26.
approximation algorithm.
h) Explain and write the Knuth-Morris-Pratt algorithm for pattern matching also write its CO4
time complexity
i) Write and explain the algorithm to solve vertex cover problem using CO3
approximation algorithm.
k Explain approximation algorithm. Explore set cover problem using approximation algorithm. CO3