ADA Question Bank.docx
ADA Question Bank.docx
FACULTY OF ENGINEERING
5TH SEMESTER
WINTER-2024
Prof.- Manish Kumar Singh
Analysis & Design of Algorithms
Question Bank
15.How do divide and conquer approaches work? What do you mean by Divide &
Conquer approach? List advantages and disadvantages of it.
2
16.Find out big-oh notation of the f(n) = 3𝑛 +5n+10
17.State whether the statements are correct or incorrect with reasons.
1. O(f(n)) + O(f(n)) = O (2f(n))
2 2
2. If 3n + 5 = O(𝑛 ) , then 3n + 5 = o(𝑛 )
18.Solve the following using Master’s theorem:
a. T(n) = 2T(n/4) + 1
b. T(n)=3T(n/4) + nlgn
2
19.Perform the analysis of a recurrence relation T(n)= 2T (n/2) + θ(𝑛 ) by drawing its
recurrence tree.
20.Explain how multiplication of large integers can be done efficiently by using
divide and conquer technique?
21.Demonstrate Binary Search method to search Key = 14, form the array
A= <2,4,7,8,10,13,14,60>.
Page 1
Analysis & Design of Algorithms
Question Bank
Page 2
Analysis & Design of Algorithms
Question Bank
Apply the
same and find MST for
the graph given below.
49.Find Minimum Spanning Tree for the given graph using Prim’s Algo.
Page 3
Analysis & Design of Algorithms
Question Bank
50.Run Dijkstra’s algorithm on the directed graph of Figure 4.3.1, first using vertex s
as the source and then using vertex z as the source.
Figure 4.3.1
51.Find the Huffman code for each symbol in the following text.
52.ABCCDEBABFFBACBEBDFAAAABCDEEDCCBFEBFCAE.
53.Given 10 activities along with their start and finish time as
𝑆=<𝐴1, 𝐴2, 𝐴3, 𝐴4, 𝐴5, 𝐴6, 𝐴7, 𝐴8, 𝐴9, 𝐴10>
𝑆𝑖=<1,2,3,4,5,6,7,8,9,10>
𝑓𝑖=<5,3,4,6,7,8,11,10,12,13>
54.Run the Bellman-Ford algorithm on the directed graph of Figure 4.3.2, using
vertex z as the source.
Figure 4.3.2
55.Solve the following Knapsack Problem using greedy methods. Number of items =
5,
56.knapsack capacity W = 100, weight vector = {50, 40, 30, 20, 10} and
profit vector = {1, 2, 3, 4, 5}.
Page 4
Analysis & Design of Algorithms
Question Bank
64.Explain the Minimax principle and show its working for simple tic-tac-toe game
playing.
65.Show how depth-first search works on the graph of the following figure.
68.A newspaper agent daily drops the newspaper to the area assigned in such a
manner that he has to cover all the houses in the respective area within minimum
travel cost.
Compute the
minimum travel
cost. The area
assigned to the
agent where he has
to drop the
newspaper is
shown in the given
figure.
Page 5
Analysis & Design of Algorithms
Question Bank
70.Show the d and π values that result from running breadth-first search on the
directed graph of the following figure, using vertex 3 as the source.
71.Let n=4(𝑃1, 𝑃2, 𝑃3, 𝑃4) = (100, 10, 15, 27) and (𝑑1, 𝑑2, 𝑑3, 𝑑4) = (2, 1, 2, 1)
where 𝑃𝑖 are profits on processes or job and 𝑑𝑖 are the deadline of
completion. Find the optimal schedule.
81.What is Finite Automata? Explain use of finite automata for string matching
with suitable examples.
82.Write pseudo-code for Naïve-String-Matching algorithm.
83.Explain Naive string matching algorithm with example.
84.Show the comparisons that naïve string matcher makes for the pattern
p=0001 in the text T=000010001010001
85.Explain rabin-karp string matching algorithm.
86.Explain spurious hits in the Rabin-Karp string matching algorithm with
example. Working modulo q=13, how many spurious hits does the
Rabin-Karp matcher encounter in the text T = 2359023141526739921 when
looking for the pattern P= 26739?
87.Use an aggregate analysis to show that the running time of
KMP-MATCHER is Ө(n)
Page 7