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.