DAA Important Questions-1
DAA Important Questions-1
Unit-1
1. Insert the following element in an initially empty RB-Tree. 12, 9, 81, 76, 23, 43, 65, 88, 76,
32, 54. Now delete 23 and 81.
2. Using minimum degree ‘t’ as 3, insert following sequence of integers 10, 25, 20, 35, 30,
55, 40, 45, 50, 55, 60, 75, 70, 65, 80, 85 and 90 in an initially empty B-Tree. Give the
number of nodes splitting operations that take place.
3. What is a binomial heap? Describe the union of binomial heap.
OR
Explain the different conditions of getting union of two existing binomial heaps. Also
write algorithm for union of two binomial heaps. What is its complexity?
4. What is Fibonacci heap? Explain CONSOLIDATE operation with suitable example for
Fibonacci heap.
5. Write a Short note on:
a. Trie
b. Skip List
Unit-3
4. Explain Greedy programming in brief. Find the shortest path in the below graph from
the source vertex 1 to all other vertices by using Dijkstra’s algorithm.
5. Write down the Bellman Ford algorithm to solve the single source shortest path problem
also write its time complexity.
Unit-4
1. Discuss knapsack problem with respect to dynamic programming approach. Find the
optimal solution for given problem, w (weight set) = {5, 10, 15, 20} and W (Knapsack size)
= 25 and v = {50, 60, 120, 100}.
3. What is the sum of subsets problem? Let w={5,7,10,12,15,18,20} and m=35. Find all
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.
4. Explain Branch and Bound method in brief. What is travelling salesman problem (TSP)?
Find the solution of following TSP using Branch & Bound method
5. What is backtracking? Explain the method of finding Hamiltonian cycles in a graph using
backtracking method with suitable example.
Unit-5
1. 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.
3. Write KMP algorithm for string matching? Perform the KMP algorithm to search the
occurrences of the pattern abaab in the text string abbabaabaabab.
reverse
in a empty red black tree and delete in the
Insert the node 15,13,12,16,19,23,5,8
order of insertion.
P=1001 in the text
Show the comparisons the naive
string matcher makes for the pattern
time to find the first occurrence of a
T=0000100010010 and show that the worst case
pattern in atext is O(n-m+1)(m-1).
tree over binary search tree.
What are the advantages of red black
Write short notes on the following:
Approximation algorithms
Fast Fourier Transformation
Randomized algorithms
Merge sort
P=26.
T=3141592653589 793 find for pattern
a. Using the Rabin Karp algorthim for text
with modulo q= 11.
finding all pairs shortest paths.
b Describe the Warshalls and Floyd salgorithm for
tree:40,35,22,90,12,45,58,78,67,60 and
a. Insert the following key in a 2-3-4 b- CO3
then delete key 35 and 22 one after other. union
heap? Explain and write an algorithm for
b. What do you mean by binomial
of two binomial heaps.
product whose sequence of
C. Findan optimal parenthesization of a matrix chain
path dimension is (5,10,3,12,5,50,6).