0% found this document useful (0 votes)
84 views8 pages

DAA Unit Wise Questions

Uploaded by

dharnakarthik160
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
84 views8 pages

DAA Unit Wise Questions

Uploaded by

dharnakarthik160
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Design And Analysis of Algorithms

Unit Wise Questions from Previous Question Papers

Unit-I

Short Answer Questions:

1. What are the properties of an algorithm?


2. If f(n)=5n2+6n+4 then prove that f(n) is O(n2).
3. Define any three asymptotic notations.
4. Arrange the following functions in increasing order?
n, log n, n2, n3, nlog n, 2n
5. Explain about recursive algorithms?
6. How can we measure an algorithm’s running time?
7. What is amortized complexity?
8. Define order of growth.
9. What is randomized algorithm.
10.Write about different types of randomized algorithms?
11.Write about Divide and Conquer general method.
12.Give the worst-case, best-case, and average-case time complexities of
binary search algorithm.
13.What is time complexity of Strassen’s matrix multiplication?
14.What is the time complexity of MergeSort and QuickSort algorithms?
15.List the asymptotic notations.
16.Explain the time complexity of merge sort.

Long Answer Questions:

1. What are the features of an efficient algorithm? Explain with an example.


2. Discuss in detail various notations used for expressing the time
complexity of algorithms, with examples.
3. What is Performance Analysis? Explain Space Complexity and Time
Complexity with examples.
4. Write control abstraction algorithm for Divide and Conquer technique?
5. Analyze the computing time complexity of binary search algorithm.
6. Explain the process of merge sort by a list of any 11 integers (distributed
randomly). Write the algorithm and analyze its time complexity.
7. Using Merge sort, sort the following elements:
310, 285, 179, 652, 351, 423, 861, 254, 450, 520
8. Write the QuickSort algorithm? Analyze the time complexity in the
worst case and average case.
9. Write and explain randomized quick sort algorithm.
10.Solve the following recurrence relations :
a) T(n) = 4T(n/2) + n2, where n ≥ 1 and is a power of 2.
b) T(n) = 2T(n/2) + nlog n
c) T(n) = 3T(n/2) + n
11.Write an algorithm to find matrix multiplication using Strassen’s and
analyze its time complexity?
12.Distinguish between Merge Sort and Quick Sort .
13.Consider the following recurrence equation:

Unit-II

Short Answer Questions:

1. Explain Disjoint set union and find operations.


2. Explain union algorithm with weighting rule.
3. Explain find algorithm with collapsing rule.
4. Write about n-queen’s problem.
5. Write about sum-of-subsets problem.
6. Describe the m-coloring graph problem.
7. What are applications of backtracking technique?
8. How sets are represented in memory?
9. What is a disjoint set?
10.Explain the fixed and variable method in sum of subsets?
11.What are implicit and explicit constraints?
12.Find the sum of subsets of the following set of integers by using the fixed
tuple method. (5,10,25,50,100) for w=75.

Long Answer Questions:

1. Write an algorithm of weighted union and also compute the time


complexity of the same.
2. Explain the Find algorithm with collapsing rule.
3. What is weighting rule for Union(i,j)? How it improves the performance
of union operation?
4. Write an algorithm of n-queen’s problem and explain.
5. Describe the Backtracking technique to the m-coloring graph. Explain
with an example its time complexity.
6. Draw the state space tree for m’ coloring hen n=3 and m=3.
7. Write an algorithm for the 8-queens problem using backtracking.
8. What is sum-of-subsets problem? Write a recursive backtracking
algorithm for sum of subsets problem?
9. Write the backtracking algorithm for the sum of subsets problem using
the state space tree corresponding to m=35, w=(20,18,15,12,10,7,5). Also
draw the state space tree.
10.Apply backtracking to solve the following instance of the subset sum
problem S={1,3,4,5) and d=11.
11.Compare and contrast BFS and DFS.
12.What is graph coloring problem? Describe the back tracking technique to
m-coloring with following planar graph shown in figure:

13.Suppose we start with n sets, each containing a distinct element.


a) Show that if u unions are performed, then no set contains more than
u+1 elements.
b) Show that at most n – 1 unions can be performed before the number of
sets becomes 1.
c) Show that if fewer than (n/2) unions are performed, then at least one
set with a single element in it remains.

Unit-III (Greedy Method)

Short Answer Questions:

1. Write the applications of Greedy method.


2. Write any two characteristics of Greedy algorithm.
3. Define a spanning tree and minimum spanning tree.
4. What is Feasible solution?
5. Can we solve 0/1knapsack problem with greedy method ? Commenton
your answer.
6. What is the importance of knapsack algorithm in our daily life?
7. State the Job – Sequencing Deadline Problem.
8. Find an optimal solution to the knapsack instance n=4 objects and the
capacity of knapsack m=15, profits (10, 5, 7, 11) and weight = (3, 4, 3,5).

Long Answer Questions:

1. Explain the problem of job sequencing with deadlines by taking an


example. Write the algorithm to solve the problem using the Greedy
Method. Show how the algorithm solves the following job sequencing
with deadlines problem. n = 4, (p1, p2, p3, p4) = (100, 10, 15, 27) and
(d1, d2, d3, d4) = (2, 1, 2, 1).
2.
a. Explain the general method of Greedy method.
b. Write and explain the Kruskal’s algorithm with an illustrative
example.
3. Write a greedy algorithm for sequencing unit time jobs with deadlines
and profits.
4. Describe the greedy method control abstraction for the subset paradigm.
5. Write an algorithm for Greedy Knapsack.
6. Write an algorithm of Prim’s minimum cost spanning tree.
7. Discuss briefly about the minimum cost spanning tree.
8. Discuss about fractional knap sack problem. Consider the following
instance of knapsack problem n=3, m=20, profits (p1, p2, p3)=(25, 24,15)
and weights(w1, w2, w3)=(18,15,10). Obtain the optimal solution using
greedy approach.
9. Write the pseudo code for Dijkstra’s algorithm for single source shortest
path problem.

Unit-IV ( Dynamic Programming)

Short Answer Questions:

1. State the principle of optimality


2. What is traveling salesperson problem?
3. What you mean by dynamic programming.
4. Define optimal binary search tree with an example
5. Give the statement of Reliability design problem.

Long Answer Questions:

1. Discuss about all pairs shortest path problem with suitable example.
2. Compute all pair shortest path for following graph shown in figure 1.

3. Describe travelling sales person problem. Find the minimum cost tour for
the following graph using dynamic programming. Costs of the edges are
given by matrix shown in figure 2.

4. Obtain all pairs shortest paths for the following:

5. Solve the following 0/1 Knapsack Problem using dynamic programming


n=4, m=30, (w1,w2,w3,w4) = (10,15,6,9) and (p1, …, p4) = (2,5,8,1).
6. Use the function OBST to compute w(i,j), r(i,j), and c(i,j), 0 ≤ i < j ≤ 4,
for the identifier set (a1,a2,a3,a4) = (do,if,int,while) with p(1:4) =
(3,3,1,1) and q(0:4)=(2,3,1,1,1). Using the r(i,j)’s construct the optimal
binary search tree.
7.
a. Solve the solution for 0/1 knapsack problem using dynamic
programming: (p1,p2,p3, p4) = (11, 21, 31, 33), (w1, w2, w3, w4)
= (2, 11, 22, 15), M=40, n=4.
b. State the principle of optimality in dynamic programming. How to
apply this to the shortest path problem?
8. Consider 4 elements al < a2 < a3 < a4 with q(0) = 1/8, q(1) = 1/16,
q(2) = q(3) = q(4) =1/16, p(1) = 1/4, p(2) =1/8, p(3) = p(4) =1/16.
Construct the table of values of W (i, j), R (i. j) and C(i, j) computed by
the algorithm to compute the roots of optimal sub trees.
9. Find an optimal solution to the 0/1 knapsack instance n=7,m=15
(p1,…p7)= (10,5,15,7,6,18,3) and (w1,…w7)= (2,3,5,7,1,4,1).

Unit-V

Short Answer Questions:

1. Write the applications of Branch and Bound problem


2. Define E-node
3. What do you mean by bounding?
4. What is meant by non-deterministic algorithm?
5. Define class P.
6. What is NP-hard problem.
7. Explain briefly about optimization problem
8. State the difference between FIFO and LC Branch and Bound algorithms.
9. Write the Control Abstraction of Least – Cost Branch and Bound.
10.Give the statement of 0/1 Knapsack FIFO BB.
11.Define P,NP,NP-Hard,NP-Complete.

Long Answer Questions:

1.
a. Explain the classes of P and NP.
b. Differentiate between NP – complete and NP-Hard.
2. a)Discuss about cook’s theorem. b) What is the satisfiability problem?
3. Draw the portion of the state space tree generated by LCBB for the
knapsack instances: n=5, (P1,P2,…,P5) = (12,10,5,9,3),
(w1,w2,...,w5)=(3,5,2,5,3) and m=12.
4.
a. Write short notes on 3-SAT problem.
b. Briefly explain deterministic and non deterministic algorithms with
example.
5. Give the relation between NP Hard and NP Complete.
6. Draw the portion of the state space tree generated by LCBB for the
following instances: n=5, m=12, (P1…..P5) = (10, 15, 6, 8, 4) (w1…w5)
= (4, 6, 3, 4, 2)
7. Draw the portion of the state space tree generated by LC branch and
bound for an instance n=4, (P1, P2, P3, P4)= (10,10,12,18), (w1, w2, w3,
w4)=(2, 4, 6, 9), and m=15
8. Explain the FIFO BB 0/1 Knapsack problem 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). Draw the portion of the state space tree and find optimal
solution.
9. Draw the portion of state space tree for the knapsack problem: N=5,
(P1,P2,…,P5)= (w1,w2,...,w5)=(4,4,5,8,9) and m=15.
10.Consider the traveling salesperson instance defined by the cost matrix and
generate the state space tree using LCBB and also use dynamic
programming design strategy.

11.
12.Identify the articulation points and draw the biconnected components.

13.
14.

1. A feasible solution that maximizes or minimizes a given objective function


is called an ……………………
2. A ………………………cycle is a path along n edges of G that visits every
vertex once and returns to its starting position.
3. Any subset that satisfies specific constraints is called ……………………
solution.
4. In …………………… method, an algorithm is devised that works in stages
considering one input at a time.
5.

You might also like