Question: Consider the following algorithm: int j = 1; int k = 1; for (i = 1; i

Consider the following algorithm:

int j = 1;

int k = 1;

for (i = 1; i <= 10; i++)

j = j * 100; consider this a basic operation

for (i = 1; i <= 20; i++)

k = k * 2; consider this a basic operation

What is the running time, T(n)? Give both the exact function T(n), and then give a big- Theta estimate of T(n). Show your work. For example, if T(n) is exactly n2 + 3n, then T(n) is big-Theta of n2. Show your work! (10 pts.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!