ADA MID SEM QUESTION BANK - Final

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Institute of Technology ,

Computer Science and Engineering

Babaria Institute of Technology


CSE/IT Department
B.E. 5th Semester
Analysis and Design of Algorithm
SUBJECT CODE: 3150703

MID SEM EXAM QUESTION BANK

1. What is an algorithm? How it differ from flowchart? Explain various properties of an


algorithm. Also Explain why analysis of algorithm is required?
2. Explain Following terms with example:
a) Set
b) Function
c) Relation
d) Quantifiers
e) Linear inequality and equations
3. Explain Asymptotic Notations. What do you mean by Case, Best Case & Average Case
and time complexity and space complexity?
4. Write selection sort algorithm. And compute running time of algorithm.
5. Explain Heap Sort with example and also discuss its complexity.
6. What is an amortized analysis?
7. Write master theorem. Solve following recurrence using it.
a. T(n) = 9T(n/3)+n
b. T(n) = 3T(n/4) + nlgn
c. T(n) = 3T(n/3) + n3
8. Write an algorithm for insertion sort. Analyze insertion sort algorithm for best case and
worst case.
9. Explain Quick Sort Method with example. Give its Time Complexity. Solve the
following problem:{4,3,1,9,8,2,4,7}
10. Sort the following list using quick sort algorithm: <50, 40, 20, 60, 80, 100, 45, 70, 105, 30,
90, 75> Also discuss worst and best case of quick sort algorithm.
11. Explain how divide and conquer methods help multiplying two large integers.
Institute of Technology ,
Computer Science and Engineering

12. Explain how to find out Longest Common Subsequence of two strings using Dynamic
Programming method. Find any one Longest Common Subsequence of given two strings
using Dynamic Programming.
S1=abbacdcba S2=bcdbbcaac
13. What is Principle of Optimality? Explain its use in Dynamic Programming Method.
14. Give optimal substructure for make change problem. Given coins of denominations 1,3
and 4 with amount to be pay is 7. Find optimal no. of coins and sequence of coins used to
pay given amount using dynamic method.
15. Solve following knapsack problem using dynamic programming algorithm with given
capacity W=5, Weight and Value are as follows :
(2,12),(1,10),(3,20),(2,15).
Write an algorithm of knapsack problem using dynamic programming.
16. Given the four matrix find out optimal sequence for multiplication D=<5,4,6,2,7>.
17. Explain Binomial Coefficient algorithm using dynamic programming.
18. Differentiate between greedy method and dynamic programming.
19. Using dynamic programming find out the optimal sequence for the matrix chain
multiplication of A4x10, B10x3, C3x12, D12x20 and E20x7 matrices.
20. Give the characteristics of Greedy Algorithms. And Elements of Greedy Strategy.
21. Give and Explain the Prim’s Algorithm to find out Minimum Spanning Tree with
illustration.
22. Give and Explain the Kruskal’s Algorithm to find out Minimum Spanning Tree with
illustration.

23. Apply merge sort algorithm on array A = {2,7,3,5,1,9,4,8}. What is time complexity of
merge sort in worst case?
24. Explain the use of Divide and Conquer Technique for Binary Search Method. Give the
algorithm for Binary Search Method. What is the complexity of Binary Search Method?

You might also like