0% found this document useful (0 votes)
7 views2 pages

DAA PracticeProblems Module-1

The document outlines various practice problems related to algorithms and data structures, including function value changes, recursive algorithms, GCD computation, and complexity analysis. It also includes tasks for proving asymptotic notations, solving recurrence relations, and analyzing algorithm efficiencies. The problems aim to enhance understanding of algorithmic concepts and complexities through practical application and theoretical proofs.

Uploaded by

ryu.asahina17
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)
7 views2 pages

DAA PracticeProblems Module-1

The document outlines various practice problems related to algorithms and data structures, including function value changes, recursive algorithms, GCD computation, and complexity analysis. It also includes tasks for proving asymptotic notations, solving recurrence relations, and analyzing algorithm efficiencies. The problems aim to enhance understanding of algorithmic concepts and complexities through practical application and theoretical proofs.

Uploaded by

ryu.asahina17
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/ 2

Sl. No.

DAA_Module-1 Practice Tutorial Problems


1.

2. For each of the following functions, indicate how much the function's value will change if its argument is
increased fourfold:
(i) log2n (ii) √n (iii) n (iv) n2 (v) n3 (vi) 2n
3. Write a recursive algorithm to solve the tower of Hanoi problem. Set up and solve recurrence relation
using backward substitution method.
4. Write the pseudocode to find the GCD of two numbers using consecutive integer method. Compute the
best case and worst-case time complexity of this algorithm.
5. Given an array of integers, write a recursive algorithm to find the smallest element in it. Set up a
recurrence relation for number of element comparisons made in this algorithm and solve it.
6. Prove that: 2n + 2n logn ≠ O(2n)
7.

8.

9. Consider the following algorithm:

i) What does this algorithm compute?


ii) What is its input size?
iii) What is its basic operation?
iv) How many times is the basic operation executed?
v) What is the efficiency class of this algorithm?
10. Solve recurrence relation through substitution method
T(n)={0 if n=0 and if n>0 T(n-2)+n2 }
11. Identify the order of growth of the following sums:

12. Prove or disprove the following equalities using the formal definition of the corresponding asymptotic
notation and also using limits theorem:
13. Derive the time complexity recurrence relation for the following code and solve it using substitution
method. Also find the space complexity for the same.

14. Analyse best, worst and average case complexities using step count method and also find space
complexity for the following code snippet:

You might also like