0% found this document useful (0 votes)
5 views1 page

Tutorial Week1 Thursday

This document outlines a tutorial assignment for the BTech course on Design and Analysis of Algorithms for the semester 2024-2025. It includes questions on the growth of functions and the execution count of print statements in nested loops. Additionally, it compares the asymptotic running times of two algorithms to determine when one outperforms the other.

Uploaded by

saiganesh.k
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)
5 views1 page

Tutorial Week1 Thursday

This document outlines a tutorial assignment for the BTech course on Design and Analysis of Algorithms for the semester 2024-2025. It includes questions on the growth of functions and the execution count of print statements in nested loops. Additionally, it compares the asymptotic running times of two algorithms to determine when one outperforms the other.

Uploaded by

saiganesh.k
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/ 1

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?

You might also like