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

Algorithm Analysis and Time Complexity

The document is an assignment focused on the analysis of algorithms, requiring the tracing of provided code and algorithms on sample data. It asks for the specification of functionality and time complexity in Big-O notation. The assignment consists of two main tasks related to algorithm analysis.

Uploaded by

mohabfata2003
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

Algorithm Analysis and Time Complexity

The document is an assignment focused on the analysis of algorithms, requiring the tracing of provided code and algorithms on sample data. It asks for the specification of functionality and time complexity in Big-O notation. The assignment consists of two main tasks related to algorithm analysis.

Uploaded by

mohabfata2003
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

Analysis of Algorithms: Assignment 1

1) Given the following code, trace it on a sample data, then specify its functionality and
its time complexity in terms of Big-O notation.
for (int i = 1; i <= 2 * n; i++)
for (int j = 1; j <= n; j++)
cout << 2 * i + j << “ “;
cout << endl;

2) Given the following algorithm, specify its type, its functionality. Then, trace it on a
sample input, and compute its time complexity.

You might also like