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

Assignment # 1: Analyze (I.e., Compute) The Running Time T (N) of The Following Nested Loops

This assignment asks students to analyze the running time of nested loops and compute T(n). It also asks students to write the combined Big-O notation for the nested loops, which include a regular for loop, another for loop with a variable dependent on the first loop, and a while loop nested inside the inner for loop using a counter variable to iterate until it reaches 0. The assignment is for the CS 250: Data Structures & Algorithms class taught by Dr. Muhammad Shahzad, and is due on November 28, 2016.

Uploaded by

abdullah1996
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)
77 views1 page

Assignment # 1: Analyze (I.e., Compute) The Running Time T (N) of The Following Nested Loops

This assignment asks students to analyze the running time of nested loops and compute T(n). It also asks students to write the combined Big-O notation for the nested loops, which include a regular for loop, another for loop with a variable dependent on the first loop, and a while loop nested inside the inner for loop using a counter variable to iterate until it reaches 0. The assignment is for the CS 250: Data Structures & Algorithms class taught by Dr. Muhammad Shahzad, and is due on November 28, 2016.

Uploaded by

abdullah1996
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

CS 250: Data Structures & Algorithms

Instructor: Dr. Muhammad Shahzad


Class: BEE-7AB

Assignment # 1
(Due date: 28.11.2016)

Analyze (i.e., compute) the running time T(n) of the following nested loops:
for i = 1 to n {
...
for j = 1 to 2*i {
...
k = j;
while (k >= 0) {
...
k = k - 1;

// assume that n is input size

}
}
}

Additionally, please also write the combined Big-O of the above code.

You might also like