0% found this document useful (0 votes)
473 views15 pages

ADA - Question - Bank 2020

The document provides information about the Analysis and Design of Algorithms course offered by the Computer Engineering and Information Technology departments at Ahmedabad Institute of Technology. It includes the visions and missions of both departments, which focus on producing technically strong and ethically responsible engineers. It also provides a question bank for the Analysis and Design of Algorithms subject, listing 34 questions related to algorithm analysis, complexity analysis, and different sorting algorithms.

Uploaded by

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

ADA - Question - Bank 2020

The document provides information about the Analysis and Design of Algorithms course offered by the Computer Engineering and Information Technology departments at Ahmedabad Institute of Technology. It includes the visions and missions of both departments, which focus on producing technically strong and ethically responsible engineers. It also provides a question bank for the Analysis and Design of Algorithms subject, listing 34 questions related to algorithm analysis, complexity analysis, and different sorting algorithms.

Uploaded by

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

Ahmedabad Institute of Technology

CE & IT Department

Analysis and Design of Algorithms(3150703)

Question Bank

Year: 2020-2021

Prepared By: - Prof. Heena Panjwani &


Prof. Neha Prajapati
CE Department Vision:
To produce technically sound and ethically responsible Computer Engineers to the society by providing
Quality Education.

CE Department Mission:

1) To provide healthy Learning Environment based on current and future Industrial demands.

2) To promote curricular, co-curricular and extra-curricular activities for overall personality development
of the students.

3) To groom technically powerful and ethically dominant engineers having real life problem solving
capabilities.

4) To provide platform for Effective Teaching Learning.

Prepared by: Prof. Heena Panjwani ADA 3150703


IT Department Vision:
To provide quality education and assistance to the students through innovative teaching learning
methodology for shaping young mind technically sound and ethically strong.

IT Department Mission:

1) To serve society by producing technically and ethically sound engineers.

2) To generate groomed and efficient problem solvers as per Industrial needs by adopting innovative
teaching learning methods.

3) To emphasis on overall development of the students through various curricular, co-curricular and extra-
curricular activities.

Prepared by: Prof. Heena Panjwani ADA 3150703


Subject Name: Analysis and Design of Algorithms
Subject Code: 3150703

UNIT 1 & 2

Sr. Question Paper Date Marks


No.

1 What is an algorithm? Explain various properties of an algorithm. 16/11/2017 4


8-11-2017

2 What is an algorithm? How it differ from flowchart? 06/06/2019 3

3 Define Algorithm, Time Complexity and Space Complexity. 27/11/2018 3

4 Define Algorithm. Discuss key characteristics of algorithm 04/05/2018 3

5 (i)Explain why analysis of algorithms is important? Explain: Worst 16/11/2017 7


Case, Best Case & Average Case Complexity. 8-11-2017
(ii) Define: Optimal Solution, Feasible solution, Principle of
Optimality.

6 Arrange following rate of growth in increasing order. 4-5-2018 2

2N, n log n, n2, 1 , n, log n, n!, n3

7 Explain Asymptotic notation. Arrange the growth rate of 2 n , n 2 , 06/06/2019 7

1, log n, n logn, 3 n and n in increasing order of growth.

8 Write an algorithm of Selection Sort Method. Give its best case, 21-5-2016 5
worst case and average case complexity.complexity.
01/05/2017 (7)

9 What do you mean by Asymptotic Notations? Explain. 16/11/2017 2


21/05/2016 (7)

Prepared by: Prof. Heena Panjwani & Prof. Neha Prajapati ADA 3150703 1
19-11-2016
1-5-2017

10 Define :Big Oh, Big Omega and Big Theta Notation. 16/11/2017 3

11 Solve the recurrence T(n) = 7T(n/2) + n 3 27/11/2018 3

12 Write the best and worst running time of Insertion sort 06/06/2019 3
algorithm. Why it differ?

13 Sort the letters of word “EXAMPLE” in alphabetical order using 21-5-2016 7


insertion sort.
8-11-2017

14 Analyze Selection sort algorithm in best case and worst case. 27/11/2018 7

15 Write the Master theorem. Solve following recurrence using it. 06/06/2019 7

(i) T(n)=9T(n/3) + n (ii) T(n)=3T(n/4) + nlgn

16 Use Iteration method to solve recurrence T(n) = T(n-1) + 1 , 06/06/2019 7


here
T(1)= Ө(1).

17 Explain Bubble sort algorithm. Derive the algorithmic complexity in 1-5-2017 7


Best case, worst case and average case analysis.

18 Solve following recurrence using master method 5-5-2017 7


T(n) = 9T(n/3) +n

19 Let f(n) and g(n) be asymptotically nonnegative functions. Using the 16/11/2017 7
basic definition of Θ-notation, prove that max(f(n), g(n)) = Θ (f(n) +
g(n)).

20 Find out the Θ -notation for the function: f(n)=27n2 +16n. 06/06/2019 7

21 Solve the following recurrence relation using iteration method. T(n) = 16/11/2017 7
8T(n/2)+ n 2 . Here T(1) = 1.
OR
Solve the following recurrence relation using substitution method.
T(n) =2T(n/2) + n. Here T(1) = 1.

Prepared by: Prof. Heena Panjwani & Prof. Neha Prajapati ADA 3150703 2
22 Prove or disprove that f(n) = 1 + 2 + 3 + .... + n ∈ Θ(n^2). 16/11/2017 4
4-5-2018

23 Which are the basic steps of counting sort? Write counting sort 16/11/2017 7
algorithm. Derive its time complexity in worst case.
4-5-2018

24 Solve following recurrence using recursion tree method: T(n) = 16/11/2017 4


3T(n/3) +n^3.
4-5-2018

25 What is an amortized analysis? Explain aggregate method of 21-5-2016 7


amortized analysis using suitable example.
19/11/2016
01/05/2017
8-11-2017

26 Explain the heap sort in detail. Give its complexity. 1-5-2017 7

27 Explain Tower of Hanoi Problem, Derive its recursion equation and 27/11/2018 3
computer it’s time complexity.

28 Find Omega (Ω) notation of function f(n)=2n2 + 6 n * lg n + 6n. 25/11/2019 3

29 Define Big-oh and Theta notations with graph. 25/11/2019 4

30 Write sequential search algorithm and analyze it for worst case time 25/11/2019 7
complexity. Represent its time complexity using Big-oh (O) notation.

31 Find upper bound of function f(n)= lg(n2) + n2lg n 25/11/2019 3

32 If P(n) = a0+ a1 n + a2 n2 + . . . . . . + amnm then prove that P(n) 25/11/2019 4


=O(nm). Here a0, a1, a2 …..am are constants and am>0.

33 Solve following recurrence relation using suitable method and express 25/11/2019 7
your answer using Big-oh (O) notation.
T(n) = T(n/3) + T(2n/3) + Ө(n)

34 Solve following recurrence relation using suitable method and express 25/11/2019 7
your answer using Big-oh (O) notation.
T(n) = 2 T(n/2) + n2

Prepared by: Prof. Heena Panjwani & Prof. Neha Prajapati ADA 3150703 3
35 If T1(n) = O(f(n)) & T2(n) = O(g(n)) then prove that T1(n) + T2(n) = 25/11/2019 3
max(O(g(n)), O(f(n))).

36 Illustrate the working of the quick sort on input instance: 25, 29, 30, 25/11/2019 4
35, 42, 47, 50, 52, 60. Comment on the nature of input i.e. best case,
average case or worst case

37 Arrange following growth rates in increasing order. 25/11/2019 3


O(n1/4), O(n1.5), O(n3lg n), O(n1.02), Ω(n6), Ω(n!), O(√n), O(n6/2),
Ω(2n)

Unit 3

1 Define an amortized analysis. Briefly explain its different 1-5-2017 7


techniques.Carry out aggregate analysis for the problem of
implementing a k-bit binary counter that counts upward from 0.

2 Analyze quick sort algorithm for best case, average case and worst 16/11/2017 7
case with example.In which case it performs similar to selection sort?
21-5-2016
4-5-2018

3 Discuss matrix multiplication problem using divide and conquer 21-5-2016 7


technique.

4 Write a program/algorithm of Merge Sort Method. What is 1-5-2017 7


Complexity of it?
8-11-2017

5 Explain the use of Divide and Conquer Technique for Binary Search 21-5-2016 7
Method.What is the complexity of Binary Search Method? Explain it
19-11-2016
with example.
01/05/2017
8-11-2017

6 Demonstrate Binary Search method to search Key = 14, form the 27/11/2018 4
array
A=<2,4,7,8,10,13,14,60> .

Prepared by: Prof. Heena Panjwani & Prof. Neha Prajapati ADA 3150703 4
7 Write Merge sort algorithm and compute its worst case and best-case 27/11/2018 7
time complexity. Sort the List G,U,J,A,R,A,T in alphabetical order
using merge sort.

8 Write greedy algorithm for activity selection problem. Give its time 25/11/2019 7
complexity. For following intervals, select the activities according to
your algorithm. I1 (1-3), I2 (0-2), I3 (3-6), I4 (2-5), I5 (5-8), I6 (3-
10), I7
(7-9)

9 Illustrate the working of the merge sort algorithm on input instance: 25/11/2019 4
10, 27, 30, 88, 17, 98, 42, 54, 72, 95. Also write best case time
complexity of merge sort algorithm.

Unit 4

1 What are the differences between greedy approach and dynamic 19/11/2016 4
programming?
01/05/2017 7
27/11/2018 3
06/06/2019

2 What are the steps for dynamic programming? Explain principal of 06/06/2019 4
optimality.

3 What are the advantages of dynamic programming method over 04/05/2018 3


devide-&- 03 conquer method?

4 Give difference of dynamic programming and divide-and- conquer 06/06/2019 4


method.

5 Discuss and derive an equation for solving the 0/1 Knapsack problem 19-11-2016 7
using dynamic programming method. Design and analyze the
algorithm for the same.

6 Discuss Assembly Line Scheduling problem using dynamic 21-5-2016 7


programming with example.

Prepared by: Prof. Heena Panjwani & Prof. Neha Prajapati ADA 3150703 5
7 Solve Making change problem using dynamic technique. d1 = 1, 27/11/2018 7
d2=2,
d3=4, d4=6, Calculate for making change of Rs. 10.

8 Explain Chained Matrix Multiplication with example. 21-5-2016 7


01/05/2017

9 Explain how to find out Longest Common Subsequence of two strings 1-5-2017 7
using Dynamic Programming method. Find any one Longest
Common Subsequence of given two strings using Dynamic
Programming. X=abbacdcba, Y=bcdbbcaac

10 Solve Making Change problem using Dynamic Programming. 1-5-2017 7


(Denominations:
d1=1, d2=4, d3=6). Give your answer for making change of Rs. 9.

11 Explain Strasson’s algorithm for matrix multiplication. 19-11-2016 7


4-5-2018

12 Explain how to find out Longest Common Subsequence of two strings 8-11-2017 7
using dynamic programming method. Find the Longest Common
Subsequence of given two strings S1 = 10010101 and S2 =
010110110

13 Solve the following making change problem using dynamic 4-5-2018 7


programming method: Amount = Rs. 7 and Denominations: (Rs. 1,
Rs. 2 and Rs. 4)

14 For the following chain of matrices find the order of parenthesization 27/11/2018 7
for the optimal chain multiplication (13,5,89,3,34).

15 Using dynamic programming find out the optimal sequence for the 06/06/2019 7
matrix chain multiplication of A 4x10 , B 10x3 , C 3x12 , D 12x20
and E 20x7 matrices.

Find the optimal way of multiplying following matrices using 25/11/2019 7


dynamic programming. Also indicate optimal number of
multiplications required.
A:3 x 2, B: 2 x 5, C:5 x 4, D: 4 x 3, E: 3 x 3

Explain Binomial Coefficient algorithm using dynamic programming. 25/11/2019 4

Prepared by: Prof. Heena Panjwani & Prof. Neha Prajapati ADA 3150703 6
Unit 5

1 Define Minimum Spanning Tree(MST). Explain Krushkal’s 21/05/2016 7


Algorithm to find MST with example.
19/11/2016
01/05/2017
8-11-2017

2 Explain Prim’s Algorithm to find Minimum Spanning Tree with 19/11/2016 7


example. What is its Time Compexity?
1-5-2017

3 Explain the characteristics of Greedy algorithms. Compare Greedy 21-5-2016 7


algorithms with Dynamic Programming Method giving example of
Knapsack Problem.

4 Explain general characteristics of greedy algorithms. 06/06/2019 4

5 Explain: Acyclic Directed Graph, Articulation Point, Dense Graph, 8-11-2017 7


Breadth First
Search Traversal, Depth First Search Traversal.

6 Write the Prim’s Algorithm to find out 5-5-2017 7


Minimum Spanning Tree. Apply the same and
find MST for the graph given below.

7 Solve following knapsack problem using dynamic programming 19-11-2016


algorithm with given capacity W=5, Weight and Value are as
follows : (2,12),(1,10),(3,20),(2,15)

8 Explain: Acyclic Directed Graph, Articulation Point, Dense Graph, 1-5-2017


Breadth First Search Traversal, Depth First Search Traversal.

9 Consider Kanpsack capacity W=50, w=(10,20,40) and v=(60,80,100) 5-5-2017 7


find the maximum profit using greedy approach.

10 Find an optimal Huffman code for the following set of frequency. a : 5-5-2017 7

Prepared by: Prof. Heena Panjwani & Prof. Neha Prajapati ADA 3150703 7
50, b: 20, c: 15, d: 30.

11 Generate minimum spanning tree using Kruskal's algorithm for the 8-11-2017 7
followin graph.

12 Consider Knapsack capacity W=9, w = (3,4,5,7) and v=(12,40,25,42) 27/11/2018 7


find the maximum profit using dynamic method.

13 Find out the NCR ( )Using Dynamic Method. 27/11/2018 3

14 Find out LCS of A={K,A,N,D,L,A,P} and B = {A,N,D,L} 27/11/2018 7

15 Explain Principle of Optimality with example. 27/11/2018 3


25/11/2019

16 Determine LCS of {1,0,0,1,0,1,0,1} and {0,1,0,1,1,0,1,1,0} 06/06/2019 7

17 Explain 0/1 knapsack using suitable example 06/06/2019 7

18 Define spanning tree and MST. How Krushkal’s algorithm is 06/06/2019 4


different from Prim’s algorithm.

19 Explain fractional knapsack problem with example. 06/06/2019 7

20 What is a minimum spanning tree? Draw the minimum spanning tree 25/11/2019 7
correspond to following graph using Prim’s algorithm.

Prepared by: Prof. Heena Panjwani & Prof. Neha Prajapati ADA 3150703 8
21 Consider the instance of the 0/1 (binary) knapsack problem as below 25/11/2019 4
with P depicting the value and W depicting the weight of each item
whereas M denotes the total weight carrying capacity of the knapsack.
Find optimal answer using greedy design technique. Also write the
time complexity of greedy approach for solving knapsack problem.
P = [40 10 50 30 60] W = [80 10 40 20 90] M = 110

22 Find the longest common subsequence for the following two 25/11/2019 7
sequences using dynamic programming. Show the complete process.
X = 100101001
Y = 101001

Unit 6

1 Explain Depth First Traversal Method for Graph with algorithm with 21-5-2016 3
example.
19/11/2016
25/11/2019

2 Explain Breath First Traversal Method for Graph with algorithm with 21-5-2016
example.
19/11/2016
5-5-2017

3 Expalin Dijkstra algorithm to find the shortest path 5-5-2017

4 Find single source shortest path using Dijkstra’s algorithm form a to 27/11/2018 4
e.

Prepared by: Prof. Heena Panjwani & Prof. Neha Prajapati ADA 3150703 9
5 Solve all pair shortest path 4-5-2018 7
problem for the following graph
using Floyd's algorithm.

6 Find all pair of shortest path using Floyd’s Algorithm for given graph 27/11/2018 7

7 4-5-2018 4

What is DFS? Explain with example. Show the ordering of vertices


produced by Topological-sort for the following graph

8 Find out the Minimum Spanning Tree using Kruskal Algorithm for 27/11/2018 7
given Graph.

9 Explain: Articulation Point, Graph, Tree 27/11/2018 4

10 Define BFS. How it is differ from DFS. 27/11/2018 4

Prepared by: Prof. Heena Panjwani & Prof. Neha Prajapati ADA 3150703 10
06/06/2019

11 Explain DFS algorithm in brief. 27/11/2018 4

12 Define graph, complete graph and connected graph. 06/06/2019 3

13 Write and explain Dijkastra algorithm with example. 06/06/2019 7

Unit 7

1 Explain Backtracking Method. What is N-Queens Problem? Give 01/05/2017 7


solution of 4- Queens Problem using Backtracking Method.
5-5-2017
8-11-2017

2 Explain use of Branch & Bound Technique for solving Assignment 1-5-2017 7
Problem.
4-5-2018

3 Explain Backtracking Method. What is N-Queens Problem? Give 21-5-2016 7


solution of 4-Queens Problem using Backtracking Method.
19-11-2016

4 Differentiate branch and bound and back tracking algorithm. 27/11/2018 4

5 Solve the following instance of knapsack problem using Backtracking 27/11/2018 7


Technique. The Capacity of the Knapsack W = 8 and w = (2,3,4,5)
and value v = (3,5,6,10)

6 Draw the state space tree Diagram for 4 Queen problem. 27/11/2018 3
25/11/2019

7 Write just steps for Backtracking and Branch-and-Bound 06/06/2019 4


algorithms.

Unit 8

1 What is finite automata? Explain with example how finite automaton 21-5-2016 7
is used for string matching?
19-11-2016

Prepared by: Prof. Heena Panjwani & Prof. Neha Prajapati ADA 3150703 11
2 Explain spurious hits in Rabin-Karp string matching algorithm with 19/11/2016 7
example.Working modulo q=13, how many spurious hits does the 21-5-2016
Rabin-Karp matcher encounter in the text T = 2359023141526739921
1-5-2017
when looking for the pattern P = 31415?
5-5-2017
8-11-2017
4-5-2018

3 What is Finite Automata? Explain use of finite automata for string 21-5-2016 7
matching with suitable example.
1-5-2017
5-5-2017

4 Explain naïve string matching algorithm with example. 5-5-2017 4


8-11-2017 3
4-5-2018
27/11/2018
25/11/2019

5 Explain finite automata algorithm for string matching. 27/11/2018 4

6 What is string-matching problem? Define valid shift and invalid 06/06/2019 3


shift.

7 Write pseudo-code for Naïve-String-Matching algorithm. 06/06/2019 3

Explain Rabin – Karp algorithm with example. What is expected 25/11/2019 7


running time of this algorithm?

Unit 9

1 Define P, NP, NP-Hard and NP-Complete Problem 27/11/2018 4


06/06/2019
25/11/2019

Prepared by: Prof. Heena Panjwani & Prof. Neha Prajapati ADA 3150703 12
2 Explain in Breif: 21-5-2016 7
P Problem, NP Problem, NP Hard Problem, NP Complete Problem 19-11-2016
01/05/2017
8-11-2017
25/11/2019

3 Travelling Salesman Problem, Recurrence Equations, Relation, 19-11-2016 7


Approximation Algorithms.
5-5-2017

4 What is Recursion? Give Recursive algorithm for Tower of Hanoi 19-11-2016 7


Problem and give analysis of it.

5 What is recurrence? Explain recursion-tree method with suitable 06/06/2019 7


example.

6 Explain “P = NP ?” problem. 06/06/2019 3

7 Explain travelling salesman problem. Prove that it is NP 06/06/2019 7


complete problem.

8 State whether Hamiltonian problem is a NP-Complete problem? 25/11/2019 7


Justify your answer

Prepared by: Prof. Heena Panjwani & Prof. Neha Prajapati ADA 3150703 13

You might also like