Course/ Batch: BTech/ SCSET Course Type: Core
Course Code: CSET244 Course Name: Design and Analysis of Algorithms
Semester: Even
Session: 2024-2025
Tutorial Assignment: Week 1
Tutorial title: Running time of the loop execution of functions, Growth of functions
CO Mapping
Question no CO1 CO2 CO3
Q1 ✓
Q2 ✓
Q3 ✓
Q1. Arrange the following list of functions in ascending order of growth.
(a) n0.01, log(n10), 2log2n , n!, nlogn , 2n, log10n
(b) √n, √logn, nn, log3n, nlogn, (1/3)n, n2/3
Q2. For the following functions, determine how many times will the print() statement be executed? Give
your answer in terms of n.
(a)
fun(n)
{
for (i=n/2; i>=1; i--)
for (j=2; j<=n; j=j*2)
print(“Nested loop execution”);
}
(b)
fun(n)
{
for(i =1; i<=n2; i++)
for (j=n; j>=1; j=j/2)
print(“Nested loop execution”);
}
Q3. Let algorithms A and B have asymptotic running times TA(n) = 20n and TB(n) = 0.1nlog2n. For which
value of n does A outperform B?