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

Question Bank DAA

Chapter 1: Introduction

1) Find time complexity using master theorem (refer class work)


2) Find time complexity using substitution method (refer class work)
3) Explain the asymptotic notations (Big O,Omega and Theta ) used while analysis of an
algorithm.

Chapter 2 : Divide And Conquer

1) Explain Divide and Conquer Methodology


2) Apply Binary Search technique to find target =7 in following array
nums = [2, 3, 5, 7, 8, 10, 12, 15, 18, 20]
3) Apply Merge sort algorithm to sort elements in ascending order

4) Apply quick Quick sort to sort elements in ascending order


44 33 11 55 77 90 40 60 99 22 88
5) Apply Heap Sort to sort elements in descending order 1, 3, 5, 4, 6, 13, 10, 9, 8, 15,
17
6) Explain Strassen’s Matrix Multiplication with example
7) Explain with example how to find Closest- Pair
8) Write a note on Convex- Hull Problems

Chapter 3: Greedy technique

1. Explain Control Abstraction for Greedy Algorithms.


2. Find MST , Single source shortest path
3. Fractional KnapSack Problem:

1) find the optimal solution for the fractional knapsack problem making use of
greedy approach. n = 5 , capacity of knapsack = 60 kg
(w1, w2, w3, w4, w5) = (5, 10, 15, 22, 25)
(p1,p2,p3,p4,p5) = (30, 40, 45, 77, 90)
Ans: 230
2) N = 3, Bag Size = 50

p = {60,100,120}

w = {10,20,30}

Ans: 240

3) N = 2, m = 50
Profit = {60,100}

weight = {10,20}

Ans: 160

4) N= 5 m=18

(w1,w2,w3,w4,w5)=(5,2,3,6,6)

(p1,p2,p3,p4,p5)=(25,12,6,24,21)

Ans: 70

5) N= 4 m=80

(w1,w2,w3,w4)=(30,60,20,50)

(p1,p2,p3,p4)=(120,60,60,100)

Ans: 240

6)

Ans : 374.44
7)

Ans: 269
8)

Ans: 6

Chapter 4 : Dynamic Programming

1. 0/1 knap sack problem

2. N = 3 ,c= 4

pi = {1,2,3}

wi = {4,5,1}

Ans: 3

3. c = 5 kg

n=4

wi = (2, 3, 4, 5)

pi = (3, 4, 5, 6)

Ans :7

2. find Matrix chain Multiplication {4,10,3,12,20,7}


3. exaplin logest comman subsequence problem by considering
S1= a b d a c e and s2= b a b c e
4. explain Floyd warshall algorithm with algorithm.
5. Find shortest path between every pair of vertex using all pair shortest path algorithm for
following graph

 ans
2.

Ans:

You might also like