0% found this document useful (0 votes)
910 views3 pages

DAA Question Bank

An algorithm is a step-by-step procedure to solve a problem or achieve some end goal. Pseudocode is an informal way to describe the design of an algorithm without syntax of a specific programming language. Complexity analysis examines how resources like time and space required by an algorithm grow as the input size grows. Asymptotic analysis describes the long-term growth rate of an algorithm's requirements as the input increases indefinitely. Dynamic programming and greedy approaches solve problems by breaking them into subproblems, but dynamic programming solves each subproblem only once and stores results while greedy approaches do not store results of subproblems.

Uploaded by

cihel
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)
910 views3 pages

DAA Question Bank

An algorithm is a step-by-step procedure to solve a problem or achieve some end goal. Pseudocode is an informal way to describe the design of an algorithm without syntax of a specific programming language. Complexity analysis examines how resources like time and space required by an algorithm grow as the input size grows. Asymptotic analysis describes the long-term growth rate of an algorithm's requirements as the input increases indefinitely. Dynamic programming and greedy approaches solve problems by breaking them into subproblems, but dynamic programming solves each subproblem only once and stores results while greedy approaches do not store results of subproblems.

Uploaded by

cihel
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/ 3

DAA

Short Type Questions


a. What is an algorithm? Describe the characteristics of an algorithm.
b. What do you mean for pseudocode and why it is used?
c. What is complexity analysis? Explain the different time complexity analysis
cases.
d. What is time-space trade off explain.
e. What do you mean for Order of Growth?
f. What do you mean of asymptotic analysis?
g. State the difference between Divide and Conquer approach and dynamic
programming approach.
h. Define the principle of optimality.
i. Find the growth order of 𝑛, 𝑙𝑜𝑔𝑛, 𝑛2 , 2𝑛 , 𝑛3 , 𝑛, 1, 𝑙𝑜𝑔𝑙𝑜𝑔𝑛, 𝑙𝑜𝑔𝑛^2 in an
increasing sequence.
j. What is the difference between Dynamic programming approach and greedy
approach?
k. What is a recurrence relation?
l. Write the difference between Algorithm and Pseudocode.

Focused Short Type Questions


1. Why asymptotic notation is used? Explain all the different types of asymptotic
notations with suitable example.
2. Solve the given recurrences by using substitution method/Iteration Methods.

𝑇 𝑛 = 𝑇 𝑛−1 +𝑛 , 𝑛≥1
0 𝑛=0
𝑇 𝑛 = 2𝑇 𝑛 − 1 + 1 , 𝑛≥1
0 𝑛=0
3𝑇 𝑛/2 + 𝑛 , 𝑛≥1
𝑇 𝑛 =
0 𝑛=0
𝑛
𝑇 𝑛 = 2𝑇 +𝑛, 𝑛>1
2
1 𝑛=1
3. Solve the following recurrences using master method.

𝑛
i) 𝑇 𝑛 = 9𝑇 +𝑛
43
2𝑛
ii) 𝑇 𝑛 =𝑇 +1
3
𝑛
iii) 𝑇 𝑛 = 2𝑇 +𝑛
2
𝑛
iv) 𝑇 𝑛 = 3𝑇 + 𝑛𝑙𝑔𝑛
4
𝑛
v) 𝑇 𝑛 = 4𝑇 + 𝑛^3
2

4. Solve the following recurrence using recursion tree method


𝑛
𝑇 𝑛 = 2𝑇 + 𝜃(𝑛)
2
𝑛
𝑇 𝑛 = 3𝑇 + 𝜃(𝑛)
3
𝑛
𝑇 𝑛 = 2𝑇 + 𝜃(𝑛^2)
2
𝑛 2𝑛
𝑇 𝑛 =𝑇 +𝑇 + 𝜃(𝑛)
3 3
5. Find the Big-oh(O), Big-omega(Ω)) and Big-theta((𝜃)) notations for the
followings:

𝑓 𝑛 = 3𝑛 + 7
𝑓 𝑛 = 5𝑛2 + 8𝑛 + 2
𝑓 𝑛 = 27𝑛2 + 16𝑛
𝑓 𝑛 = 3𝑛3 + 4𝑛 + 2
𝑓 𝑛 = 4𝑛3 + 2𝑛 + 3
𝑓 𝑛 = 5𝑛3 + 8𝑛2 + 2𝑛 + 4
𝑓 𝑛 = 5𝑛5 + 8𝑛4
6. Prove or disprove the followings:

i)(𝑛 + 𝑎)𝑏 = 𝜃(𝑛𝑏 )


ii)3𝑛 + 5 = 𝑜(𝑛2 )
iii)2𝑛+1 = 𝑂(2𝑛 )
iv)7𝑛 + 3 = 𝜔(1)

Long Type Questions

1. Write down the algorithm of Mergesort and Merge procedure. Find its
complexity.
2. Write down the algorithm of Quicksort and Partition procedure. Find its
complexity.
3. Find an optimal parenthesization of matrix chain multiplication whose sequence
of dimension is <30, 35, 15, 5, 10, 20, 25>
4. Find an optimal parenthesization of matrix chain multiplication whose sequence
of dimension is <5,10,20,30,40>
5. Find an optimal parenthesization of matrix chain multiplication whose sequence
of dimension is <5,10,20,30,40>
6. Write down the algorithm for computing the length of an LCS. Find LCS from
the given sequence X={A,B,C,B,D,A,B} and Y={B,D,C,A,B,A}
7. Write down the algorithm for computing the length of an LCS. Find LCS from
the given sequence X={a,b,b,b,a,a,b,a} and Y={a,b,a,a,b,a,a,b}
8. Write down the algorithm for computing the length of an LCS. Find LCS from
the given sequence X={1,0,0,1,0,1,0,1} and Y={0,1,0,1,1,0,1,1,0}
9. Given a list of activities along with the start time and finishing times
<1,3>,<2,5>,<3,4>,<4,7>,<7,10>,<8,9>,<9,11>,<9,13>,<11,12>,<12,14>
Compute a schedule where the largest number of activities takes place.
10.Given a list of activities along with the start time and finishing times
<1,4>,<3,5>,<0,6>,<5,7>,<3,8>,<5,9>,<6,10>,<8,11>,<8,12>,<2,13>,<12,14>
Compute a schedule where the largest number of activities takes place.

You might also like