* Please answer the following Computer Algorithms question and its two parts: Part A: Part B: Consider the following code: counter=0; for (int i=0; i

icon
Related questions
Question
100%

Hello. Please answer the attached Computer Algorithms question and its two parts correctly.

*If you answer the question's two parts correctly, I will give you a thumbs up. Thanks.

* Please answer the following Computer Algorithms question and its two parts:
Part A:
Part B:
Consider the following code:
Assume that factorial(n) computes the value of n!. Consider the
following code:
counter=0;
counter=0;
for (int i=0; i<n; i++)
for (int i=1;i<factorial(n); i*=2)
for (int j=1; j<n; j*=2)
counter++;
After this code is run, if counter (nk (logn)),
what is c + k?
* Please answer both parts correctly, and
I will provide a Thumbs Up. Thank you.
counter++;
After this code is run, if counter = (nk (log n)), what is c + k ?
Transcribed Image Text:* Please answer the following Computer Algorithms question and its two parts: Part A: Part B: Consider the following code: Assume that factorial(n) computes the value of n!. Consider the following code: counter=0; counter=0; for (int i=0; i<n; i++) for (int i=1;i<factorial(n); i*=2) for (int j=1; j<n; j*=2) counter++; After this code is run, if counter (nk (logn)), what is c + k? * Please answer both parts correctly, and I will provide a Thumbs Up. Thank you. counter++; After this code is run, if counter = (nk (log n)), what is c + k ?
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer