Вы находитесь на странице: 1из 2

Design & Analysis of Algorithm (181604)

Assignment-1
1. How to compare the two algorithms? What do you mean by worst-case, average-case and
best-case analysis of an algorithm? Is a Recursive algorithm less efficient compared to an
Iterative one? Why or Why not?
2. Define: (1) Algorithm (2) Average case (3) Time complexity (4) Space complexity (5) Set
(6) Function (7) Relation
3. Write algorithms to find (1) Sum of integers from 1 to n. (2) Fibonacci sequence using
recursion and calculate the time complexity for both on each case.
4. Define Time Complexity and Space Complexity. Why we are generally concerned with
Time Complexities than Space Complexities (Requirements)? What do you mean by
Polynomial time complexity and Logarithmic time complexity? Which one is higher?
What is a major contributor for inefficiency of a loop?
5. What do you mean by performance analysis of an algorithm? Explain average case and
worst case analysis with the help of suitable example
6. What is an Algorithm? What do you mean by linear inequalities and linear equation?
Explain asymptotic notation with the help of example.
7. Explain Asymptotic Notation with example
8. Explain all asymptotic notations used in algorithm
9. What do you mean by Polynomial time complexity and Logarithmic time complexity
which one is higher? What does O (1) mean?
10. What are the elementary operations? Explain Amortized Analysis.
11. Write an algorithm for binary search. Calculate the time complexity for each case.

Assignment-2
1. Explain how to apply the divide and conquer strategy for sorting the elements using
Merge sort.
2. Explain how to apply the divide and conquer strategy for sorting the elements using
Merge sort.
3. Differentiate the following: 1. Divide and conquer & Dynamic Programming 2. Greedy
Algorithm & Dynamic Programming.
4. What do you mean by minimum spanning tree? Explain single source shortest path with
the help of example.
5. Write the quick sort algorithm and trace the same on data set : 5,3,1,9,8,2,4,7
6. Solve the following Knapsack Problem using Greedy Algorithm the capacity of knapsack
is 15. Items 1 2 3 4 5 6 7
Weight 2 3 5 7 1 4 1 Value 10 5 15 7 6 18 3.
7. State Principle of optimality. Principle of optimality does not hold for all problems whose
solutions can be viewed as a sequence of decisions. Find out such problem and show that
it fails
8. Prove that Greedy Algorithms does not always give optimal solution. What are the general
characteristics of Greedy Algorithms? Also compare Greedy Algorithms with Dynamic
Programming and Divide and Conquer methods to find out major difference between them.

9. Give and explain Kruskals Algorithm for Minimum Spanning Tree and Compare it with
Prims algorithm with an example.
10. Give the algorithm to find the best way to multiply n matrices. Analyze the algorithm and
give the timing analysis.
11. Compute Matrix chain order for the following matrices, A1 (5 X 4), A2 (4 X 6),
A3 (6 X2), and A4 (2 X 7).
12. Compute Longest common subsequence for the strings,
A=<X,Y,Z,Y,T,X,Y>, B=<Y,T,Z,X,Y,X>

Assignment-3
1. Give the algorithm with example to solve 0/1 Knapsack Problem using Dynamic
Programming.
2. Differentiate between Greedy, Dynamic Programming and Divide and Conquer method.
3. Define Graph. Explain types of graph and different ways of graph representations.
4. What is an articulation point? Give applications of BFS and DFS. Generate at least 3
solutions for 5 queens problem.
5. What is backtracking? Explain P, NP and NP complete problems
6. What is the need of matching the string? Explain Finite automata for string matching.
7. Give the important properties of relation and also solve 8 queens problem for a feasible
sequence (6, 4,7, 1)
8. Explain Rabin Karp method of string matching.
9. Explain Depth First Search (DFS) algorithm and it can be used to find the connected
components of an undirected graph. Justify the statement with reason.
10. Write an algorithm for depth first search of a graph and explain with an example. Write an
algorithm for breadth first search of a graph and explain with an example.
11.Given two sequences of characters: P=<MLNOM> & Q=<MNOM>. Obtain the longest
common subsequence.
12. Define String-matching problem. Compare all string matching algorithms.
13. What is polynomially turing reducible problem? Explain with example how problem A can be
polynomially Turing reduced to problem B.

Вам также может понравиться