Sei sulla pagina 1di 12

QUESTION BANK (UNIT I )

CS6402- DESIGN AND ANALYSIS OF ALGORITHMS

Part - A
1. What do you mean by algorithm? (May’13)
2. Define algorithm design techniques.
3. List out the ways of representing an algorithm.
4. How to estimate the running time(T(n) of a problem?
5. Define Big-Oh notation. (May’13)
6. Define little Oh and Omega notations.(Nov’13)
7. Why is an algorithm important in problem solving? (Nov’12)
8. State algorithm efficiency. (Nov’12)
9. List out the basic asymptotic efficiency classes.
10. Establish the relationship between O and Ω (Dec2013)
11. What do you mean by linear search?
12. List the properties of big – O notation
13. Differentiate Time Complexity and Space Complexity
14. What is a recurrence equation? List the ways to solve a recurrence equation
15. What is called Substitution method?
16. Using the step count method analyse the time complexity when 2 m × n matrices are added
17. Solve the recurrence T(n)=2T(n-1) + 1 ; T(1) = 0
18. Write an algorithm to multiply 2 matrices of order N × N each.
19. o(g(n)) ∩ ώ(g(n)) = _____________

20. Define recurrence. What are the 3 ways in which recurrence is implemented?

21. State the recurrence relation for merge sort

22. Prove n=O(n log n)

23. Prove n3=Ώ(n2 )

24. Prove n2/2 – 2n =Θ(n2)

25. solve the recurrence for the following


x(n)=x(n-1)+n for n>0 and x(0)=0
x(n)=x(n/3)+1 for n>1 and x(1)=1

Part - B

1. Briefly explain time and space complexity estimation. (May’13)

2. Write Linear Search algorithm and analyze its complexity. (May’13)

3. Explain the Towers of Hanoi problem and solve it using recursion.(Nov’13)

4. Solve the given recurrence relation.

T(n)= 2T(n/2)+2 n>2

1 n=2

0 n=1

5. Explain in detail the empirical analysis of algorithm. (Nov’12)

6. Explain Asymptotic Notations using proper graphs

7. Solve the Recurrence : T(n) = 5T(n-1) - 6T(n-2) ; T(1) = 1

8. Solve the Recurrence : T(n) = 2T(n/2) + nlgn

9. You are given two sets of distinct integers S1 and S2 of length m and n respectively. Write an algorithm that
runs in O(m+n) time to check if all the numbers in S1 are less than all the elements in S2.

10. Write a recursive and non-recursive algorithm to calculate the factorial of a given number N. Calculate the
time complexity for each of your algorithm.

11. Write a recursive and non-recursive algorithm to calculate the Nth Fibonacci number for a given positive
number N. Calculate the time complexity for each of your algorithm.

12. Define Recurrence equation and explain how recurrence equations are solved.

13. Explain how Time Complexity is calculated with an example. (16)

14. Write an algorithm to perform binary search on a sorted list of elements. Analyze the algorithm for the best
case, average case and worst case.(AM2011,ND2012)

15. Explain in detail with example the types of computing problems.

16. Explain in detail the sequence of steps needed for algorithmic problem solving.
UNIT -II Question Bank

CS6402 DESIGN AND ANALYSIS OF ALGORITHM


1. Define brute force approach .State its pros and cons.
2. What is selection sort?Derive its complexity.
3. Sort the list E, X, A, M, P, L, E in alphabetical order by selection sort. And bubble sort.
4. What is bubble sort?Derive its complexity.
5. What are the improvements that can be made on sequential search?
6. Derive the complexity of brute force string matching algorithm.
7. Determine the number of character comparisons made by the brute-force algorithm in searching for
the pattern GANDHI in the text
THERE_IS_MORE_TO_LIFE_THAN_INCREASING_ITS_SPEED.
8. In solving the string-matching problem, would there be any advantage in comparing pattern and text
characters right-to-left instead of left-to-right?
9. State the closest pair problem and derive its complexity.
10. State the convex hull problem. Give example.
11. Define the terms convex hull,convex set ,convex polygon,extreme points
12. what is the order of convex hull problem?explain.
13. Find the convex hulls of the following sets and identify their extreme points a.Line segment b. a
square c. the boundary of a square d. a straight line.
14. Define exhaustive search technique.state its strength and weakness.
15. Define traveling salesman problem, Knapsack problem,assignment problem with example.
16. What do you mean divide and conquer strategy? State the general plan for working of divide and
conquer algorithm.
17. State the general divide and conquer recurrence equation and explain.
18. Define recurrence. What are the 3 ways in which recurrence is implemented?
19. Define multi -way merge sort.State the recurrence relation for merge sort.
20. State the master theorem.
21. What is the worst case, best case and average case running time for merge sort.
22. Show the intermediate steps when the numbers 123, 23, 1, 43, 54, 36, 75, 34 are sorted using merge
sort.
23. Compare divide and conquer approach with dynamic programming and greedy programming
approach.
24. Compare the number of key comparisons made in merge and quick sort.
25. What are the 3 improvements that can be applied to quick sort.Show that quick sort’s best-case
running time is Ω(n lg n).
26. What are the smallest and largest numbers of digits the product of two decimal n-digit integers can
have?
27. Compute 2101 x 1130 by applying the divide-and-conquer algorithm.
28. What is the complexity of divide and conquer algorithms.
29. List out any two drawbacks of binary search algorithm.
30. What is the concept of convex hull problem?
31. State the recurrence relation for closest pair problem.
16 marks

1. With an example, explain how the exhaustive search technique is used to solve 0/1 knapsack problem.
2. Explain how exhaustive search is applied to solve traveling salesperson problem.
3. Explain how exhaustive search is applied to solve assignment problem.
4. Using exhaustive search, find the optimal solution to a knapsack problem for the knapsack instance n = 7
m = 15, (p1, p2. ... p7) = (10,5,15,7,6,18,3) and (w1, w2,...,w7) = (2,3,5,7,1,4,1).
5. Explain how exhaustive search is applied to solve closest pair and convex hull problem.
6. Explain how exhaustive search is applied to solve sequential search and string matching problem and
state its complexity.
7. Explain how exhaustive search is applied to solve selection sort and bubble sort and state its complexity.
8. Explain Merge Sort Problem using divide and conquer technique. Give an example. (AM 2010)
9. Using the divide and conquer approach to find the maximum and minimum in a set of ‘n’ elements. Also
find the recurrence relation for the number of elements compared and solve the same.
(AM2011,AM2010)
10. Distinguish between quick sort and merge sort and arrange the following numbers in increasing order
using merge sort(18,29,68,32,43,37,87,24,47,50) (AM2013)
11. What is divide and conquer strategy and explain the binary search with suitable example problem.
(ND2011)
12. Write an algorithm that multiplies two nxn matrices using O(n3) operations. Determine the precise
number of multiplications ,additions and array element access.
13. Briefly discuss the procedure used in strassen multiplication and analyze its efficiency.Use Strassen’s
algorithm to compute the matrix product

a.i.1.

14. Discuss how divide and conquer technique can be applied to convex hull problem with suitable algorithm.
15. Discuss how divide and conquer technique can be applied to closed pair problem with suitable algorithm.
CS6402 DESIGN AND ANALYSIS OF ALGORITHM

QUESTION BANK (UNITS III)

Part - A

Unit III

1. What is spanning tree? What is minimum spanning tree?


2. State the general principle of greedy algorithm.
3. State the principle of optimality.

4 Compare Divide and Conquer with Dynamic Programming and Dynamic Programming
with Greedy approach.

5. Write the recurrence equation for memory functions.

6. State 0/1 knapsack problem. How it varies from fractional knapsack problem.

7. Define optimal binary search trees.

8. Devise a greedy algorithm to make a change of 1655 from the following coins {1000,
500, 100, 50, 20, 10, 5}

9. Write an algorithm to find the shortest path from every node to every other node in a
graph G. What is the strategy you followed?

10.What is the importance of memory functions?


11.State the applications of Dijikstra’s shortest path algorithm.
12.Give warshall algorithm.
13.How many binary search trees can be formed with ‘n’ keys.
14. What is a transitive closure?State the algorithm used to find transitive closure.
15.Define feasible and optimal solutions.
16.Define multistage graphs.
17.List the advantages and disadvantages of Dynamic programming and greedy
technique.
18. State the properties of binomial co-efficient. Prove the order of binomial algorithm as
O(nk).
19.what is the difference between pure recursive solution and a dynamic programming
solution to a problem?
20.Define Huffmann tree and code,dynamic huffmann coding.
16 Marks.

1. How a binomial coefficient is calculated using dynamic programming. Derive its


complexity. Give example.
2. Use function OBST to compute w(i, j), r(i, j), and c(i, j), 0<=i<j<=4, for the
identifier set (α1,α2, α3, α4)= (cout, float, if, while) with p(1) = 1/20, p(2) =1/5,
p(3) = 1/10, p(4) = 1/20, q(0) = 1/5, q(1) = 1/10, q(2) = 1/5, q(3) = 1/20,and q(4)
1/20. Using the r(i, j)’s, construct the optimal binary search tree.
3. Write and explain the algorithm to solve all pairs shortest paths problem.Solve
all-pairs shortest path problem for the digraph with the weight matrix given
below.

4. Write the algorithm to compute the 0/1 knapsack problem using dynamic
programming and explain it.Solve the following instance of the0/1 knapsack
problem given the knapsack capacity is W=5

a.i.
5. Write and explain warshall's algorithm.Apply warshall’s algorithm to find the
transitive closure of the digraph defined by the following adjacency matrix
A B C D

A 0 1 0 0
B 0 0 0 1
C 0 0 0 0
D 1 0 1 0
6. Obtain optimal binary search tree for the following problem instance

Key A B C D

Probabilit 0.1 0.2 0.4 0.3


y

7. Explain how Floyd’s algorithm is used in finding the shortest path. Give example.
8. Write algorithm’s for Prim’s algorithm and kruskal’s algorithm and apply to the
graph to obtain minimum spanning tree.Do these algorithms generate same
output-justify.
9. Write short notes on memory functions.
10. Expalin in detail the Huffmann coding algorithm with example.

UNIT - IV

2 MARK QUESTIONS:

1. Define the iterative improvement technique.

2. List the standard form requirements of linear programming problem in simplex


method.

3. Define the extreme Point theorem .

4. Define basis and non-basic solution

5. List the steps of simplex method.

6. What is two phase simplex method?

7. Define Ellipsoid method.

8. What is Bland’s rule?

9. Differentiate Feasible and optimal solution

10. State the maximum flow problem.

11. List the properties of flow network

12. Define Max-Flow Min-Cut Theorem

13. What is Flow conservation requirement?

14. Define Augment path method/ Ford-fulkerson method

15. What is shortest augment path algorithm?

16. Define bipartite graph.

17. What is maximum cardinality matching?

18. Write the stable marriage algorithm.


19. Define forward and backward edges.

20. Define a blocking pair.

16 MARK QUESTIONS
1. Describe in detail about the simplex method with an example.

2. Explain geometric interpretation of Linear programming with example.

3. Trace the simplex method on the following problems

Maximize p= 2x-3y=4z Subject to 4x-3y+z<=3 x+y+z<=10 2x+y- z<=10 where x, y and


z are non negative

4. Explain the maximum flow problem algorithm and prove the max Flow min cut
theorem.

5.Apply the shortest augmenting path algorithm to find a maximum flow and minimum
cut in the following network

6. Write the algorithm for maximum matching in Bipartite Graphs and prove the theorem
with example.

7. Apply the maximum matching algorithm to the following bipartite graphs.

8. Explain the algorithm for stable marriage problem and prove the theorem with
Example.

9. Consider an instance of the stable marriage problem given by the ranking matrix. For
each of its marriage matching’s, indicate whether it is stable or not
10. Illustrate pictorially the Ford –Fulkerson method by showing the flow augmenting
paths in bold for the given flow network.
CS6402 DESIGN AND ANALYSIS OF ALGORITHM

Unit V

2 Marks

1. State the general principle of backtracking.


2. What is NP-completeness?Give an example for NP-complete problem.
3. Define NP-hard and class NP problems..
4. What is “chromatic number” of a graph?
5. Differentiate explicit and implicit constraints.
6. What is the difference between live node & dead node?
7. What is a biconnected graph?Define strongly connected graph.
8. What is graph coloring problem?Give some practical applications of Graph
coloring problem.
9. What is FIFO branch and bound algorithm?
10. State Hamiltonian problem.What is a Hamiltonian circuit? Define a graph with a
cycle but no Hamiltonian cycle.
11. List 4 problems that can be solved by backtracking.
12. List the differences between backtracking and branch and bound algorithm.
13. When will you say that a node is promising in knapsack problem when solved
using backtracking?
14. Differentiate tractable and intractable problems with an example for each.
15. Write down the approximation algorithm for the discrete knapsack problem.
16. .What is Bin packing?
17. Which technique is used to construct state space tree? Give example.
18. Give the list of some well –known problems that are NP-complete when
expressed as decision problems?
19. What is nearest- neighbor algorithm?
20. When do we terminate a search space tree of a branch and bound?
21. Define heuristics .Give example.
22. Define C-approximation algorithm.
23. Define local search heuristics.
24. State the types of approximation algorithm for TSP.
25. Define class P problems.
26. State the CNF-satisfiability problem
27. Define Lower bound.State the methods to obtain lower bound.
16 MARKS

1. Solve the travelling salesman problem using branch and bound technique.
2. Draw complete state space tree of the backtracking algorithm applied to the
following instance of sum of subsets and mark the solution node.S={3,5,6,7} and
d=15.
3. Explain how backtracking can be applied to solve 8-queen’s problem.
4. Discuss approximation algorithm NP hard for travelling salesman problem.
5. Discuss class P,NP,NP hard and NP complete problems with examples.
6. Develop an algorithm for solving the assignment problem by the branch and
bound technique.
7. What stratergy is used to find the minimum assignment and how?
8. Design a polynomial time algorithm for a 2 coloring problem .Determine whether
vertices of a given graph can be coloured in no more than 2 colors.
9. What is backtracking?Explain why backtracking is defined as a default procedure
of last resort for solving problems.
10. Explain Hamiltonian circuit problem algorithm with a suitable example.
11. Write a non deterministic knapsack algorithm.
12. Consider the below matrix for assignment problem involving persons and
jobs.Explain in detail how branch and bound technique is useful in solving
assignment problems.

JOB JOB2 JOB3 JOB4


1

9 2 7 8

6 4 3 7

5 8 1 8

7 6 9 4

13. Explain in detail about subset sum problem using backtracking technique.

Potrebbero piacerti anche