Daa QB
Daa QB
(Autonomous)
ApprovedbyAICTE,
NewDelhi&AffiliatedtoJNTUH,HyderabadAccredited byNAAC
withAGrade,Accreditedby NBA
Course Objectives:
Introduces the notations for analysis of the performance of algorithms.
Introduces the data structure disjoint sets.
Describesmajoralgorithmictechniques(divide-and-
conquer,backtracking,dynamicprogramming, greedy, branch and bound methods) and
mention problems for which eachtechniqueisappropriate;
Describes how to evaluate and compare different algorithms using worst-, average-,
and best-caseanalysis.
Explainsthedifferencebetweentractableandintractableproblems,andintroducestheproble
msthatare P, NP and NP complete.
CourseOutcomes(CO’s):
Ability to analyze the performance of algorithms
Ability to choose appropriate data structures and algorithm design methods for a
specified application
Ability to understand how the choice of data structures and the algorithm design
methods impact the performance of programs
UNIT–I
INTRODUCTION OF ALGORITHM
S.No Questions BT CO PO
Part –A(Short Answer Questions)
1 Define the term algorithm and state the criteria the algorithm L1 CO1 PO1
2 Define order of an algorithm and the need to analyze the L4 CO1 PO2
algorithm.
3 Define asymptotic notations :big‘ Oh’, omega and theta? L3 CO1 PO1
4 Distinguish between Algorithm and Pseudocode. L2 CO2 PO1
5 State the best case and worst case analysis for binary search L1 CO1 PO2
6 State the best case analysis of quick sort . L4 CO2 PO2
7 Give the recurrence equation for the worst case behavior of merge L1 CO3 PO2
sort
8 Compute the average case time complexity of quick sort L1 CO2 PO1
9 How the performance can be analyzed? Explain with the example. L1 CO1 PO1
10 Describe best case, average case and worst case efficiency of an L2 CO2 PO1
algorithm?
Part– B(Long Answer Questions)
11 a) Discuss various the asymptotic notations used for best case L4 CO2 PO1,
average case and worst case analysis of algorithms. 2
b) Define i) Time Complexity ii) Space Complexity L5 CO2 PO2
12 a) Discuss binary search algorithm and analyze its time complexity L6 CO1 PO2,
3
b) Explain the algorithm of quick sort with example and find the time L3 CO2 PO3
complexity
13 a) Explain binary search algorithm L1 CO3 PO3,
4
b) Explain the algorithm of Merge sort with example and find the time L2 CO2 PO4
complexity.
14 a) Give the algorithm for Stassen’s matrix multiplication and find the L3 CO3 PO5
time complexity.
b) Explain the properties / characteristics of an algorithm with an example. L2 CO1 PO3
15 a) Write a java program to implement Quick sort algorithm for L3 CO2 PO2
sorting a list of integers in ascending order.
b) Sort the list of numbers using merge sort:78,32,42, 62, 98, 12, 34, L4 CO1 PO4
83,10
16 a) Discuss binary search algorithm and analyze its time complexity L1 CO3 PO5
b) Discuss various the asymptotic notations used for best case L2 CO4 PO4
average case and worst case analysis of algorithms
UNIT–II
DISJOINT SET
S. No Questions BT CO PO
Part –A(Short Answer Questions)
1 Describe union operation on sets L3 CO1 PO2
2 Describe find operation on sets L1 CO2 PO3
3 Define a spanning tree and minimal spanning tree L2 CO3 PO5
4 Define Graph in DAA ? L3 CO1 PO7
5 Define Tree in DAA ? L4 CO2 PO1
6 Differentiate Graph and Tree L5 CO2 PO5
7 What is set? Write different types of set operation? L3 CO3 PO3
8 Explain different types UNION and FIND algorithm with example? L1 CO1 PO7
9 What is Disjoint set ? Give an example. L3 CO1 PO9
10 Define a connected and bi-connected component L2 CO2 PO4
Part– B(Long Answer Questions)
11 a) What is a Backtracking and give the 4 – Queens’s solution. Draw the L3 CO1 PO2
portion of thestate space tree for n = 4 queens using backtracking
algorithm
b) What is a Hamiltonian Cycle? Explain how to find Hamiltonian L2 CO2 PO4
path and cycle using backtracking algorithm.
12 a) Give the statement of sum –of subsets problem. Find all sum L4 CO1 PO6
of subsets for n=4, (w1, w2, w3, w4) = (11, 13, 24, 7) and
M=31.Draw the portion of the state space treeusing fixed –
tuple sized approach.
b) Define: i) State Space tree ii) E – Node iii) Dead Nod L3 CO2 PO7
13 a) Define Chromatic number & Give the state space tree for 4 – Coloring L1 CO1 PO5
problem.
b) Explain the Graph – coloring problem. And draw the state L2 CO3 PO7
space tree for m= 3colors n=4 vertices graph. Discuss the
time and space complexity.
14 a) Differentiate divide and conquer and greedy method L2 CO2 PO5,
6
b) Write an algorithm for N – queen’s problem. Give time and space L3 CO1 PO6
complexity for8 – queen’s problem.
15 a) Distinguish between Dynamic Programming and Greedy method. L4 CO2 PO7
b) What is Graph in DAA? Give an example L1 CO3 PO8
16 a) Explain waiting rule for finding UNION of sets and collapsing L2 CO2 PO4
Rule
b) Explain with examples find() and Union() algorithms L3 CO2 PO4
UNIT–III
DYNAMIC PROGRAMMING
S. No Questions BT CO PO
Part –A(Short Answer Questions)
1 Define greedy method L2 CO1 PO2
2 Define job sequencing with deadlines problem L3 CO2 PO4
3 Define minimum cost spanning tree L2 CO3 PO5
4 Define Knapsack problem? L3 CO3 PO6,
7
5 Define Prim’s algorithm L2 CO1 PO8
6 Define Kruskal’s algorithm L1 CO2 PO9
7 Define single source shortest path problem L3 CO4 PO1
1
8 Define dynamic programming L1 CO5 PO1
0
9 List the features of dynamic programming L2 CO3 PO8
10 Distinguish greedy method and dynamic programming L1 CO2 PO9
12 a) Give the statement of Reliability design problem and explain with L2 CO2 PO1
suitable example.
b) Explain prims algorithm with example L3 CO3 PO9
13 a) Explain Kruskal’s algorithm with example L1 CO1 PO8
b) What is Reliability design with example L2 CO3 PO5
14 a) Explain optimal binary search tree algorithm with example L3 CO4 PO9
b) Explain 0/1 knapsack problem with example L1 CO3 PO3
15 a) What is All – Pair Shortest Path problem (APSP)? Discuss the Floyd’s L2 CO1 PO6
APSP algorithm and discuss the analysis of this algorithm.
b) Describe the travelling sales man problem and discuss how to L4 CO2 PO9
solve it using dynamic programming?
16 a) Explain Kruskal’s algorithm with example L1 CO3 PO5
b) Describe the Dynamic 0/1 Knapsack Problem. Find an optimal L1 CO1 PO3
solution for the dynamic programming 0/1 knapsack instance for n=3,
m=6, profits are (p1, p2, p3 ) = (1,2,5), weights are
(w1,w2,w3)=(2,3,4).
UNIT–IV
GREEDY METHOD
S. No Questions BT CO PO
Part –A(Short Answer Questions)
1 Define i) Feasible solution ii) Optimal solution. L1 CO2 PO2
2 Define Greedy Method? L2 CO3 PO4
3 What is spanning tree ? give example L3 CO2 PO7
4 What is job sequence with dead line? L1 CO1 PO5
5 What is minimum spanning tree? L4 CO2 PO5
6 What is single source shortest path ? L4 CO1 PO3
7 What is time complexity of job sequence with dead line? L4 CO3 PO8
8 What is time complexity of spanning tree? L4 CO1 PO6
9 What is time complexity o single source shortest path ? L1 CO2 PO3
10 Distinguish between Prim’s and Kruskal’s spanning tree algorithm. L1 CO3 PO9
12 a) Discuss the single – source shortest paths (i.e. Dijkstra’s) algorithm with L2 CO2 PO7
suitableexample and also find the time complexity.
b) What is a Spanning tree? Explain Prim’s Minimum cost spanning tree L3 CO1 PO9
algorithm withsuitable example and also find the time complexity.
13 a) Find an optimal sequence to the n=5 Jobs where profits L1 CO2 PO1
(P1,P2,P3,P4,P5) =(20,15,10,5,1) and deadlines (d1,d2,d3,d4,d5) =( 1
2,2,1,3,3).
b) What is a Minimum Cost Spanning tree? Explain Kruskal’s L4 CO3 PO5,
Minimum costspanning tree algorithm with suitable example and also 7
find the time complexity
14 a) State the Greedy Knapsack? Write the algorithm for Greedy knapsack L1 CO1 PO4
and alsocompute the time complexity
b) Write an algorithm for job sequence with dead lines. L1 CO2 PO7
15 a) Write an algorithm for Kruskal’s algorithm. L1 CO2 PO1
UNIT–V
BRANCH AND BOUND
S. No Questions BT CO PO
Part –A(Short Answer Questions)
1 Define class P? L4 CO1 PO4
2 Compare NP-hard and NP-completeness L4 CO2 PO6
3 Define NP-hard problem L4 CO3 PO7
4 Define NP-complete problem L4 CO1 PO7
5 Define deterministic problem? L4 CO2 PO2
6 Define non-deterministic problem L4 CO1 PO1
7 Define i) LC – Search ii) Branch and Bound (BB) iii) FIFO – BB. L4 CO3 PO5
8 Explain optimization problem L1 CO2 PO9
9 Define Bounding Function? L1 CO3 PO2
10 Define Cook’s theorem? L1 CO1 PO3
Part– B(Long Answer Questions)
11 a) Draw the portion of state space tree generated by FIFOBB for the job L2 CO2 PO8
sequencing with deadlines instance n=5 , (p1,p2,..,p5) =(6,3,4,8,5),
(t1,t2,..t5) = (2,1,2,1,1) and (d1,d2,..,d5)=(3,1,4,2,4).What is the penalty
corresponding to an optimal solution
b) Explain deterministic and non-deterministic algorithms L1 CO3 PO9
12 a) Write non deterministic algorithm for sorting and searching L4 CO1 PO6
b) Write anon-deterministic knapsack algorithm L1 CO3 PO1
0
13 a) Explain P and NP problems are related L1 CO3 PO4
b) Distinguish NP- hard and NP-complete problems L3 CO4 PO2
14 a) Define Bounding Function? Give the statement of 0/1 Knapsack FIFO L1 CO2 PO9
BB and explain the procedure with the knapsack instance for
n=4.m=15,(p1,p2,p3,p4)=(10,10,12,18) (w1,w2,w3,w4) =(2, 4, 6, 9).
b) Distinguish between backtracking and branch – and bound techniques. L1 CO3 PO1