Question

Please DONOT attempt this Big O question if you don't know the exact answer. Algorithms question...

Please DONOT attempt this Big O question if you don't know the exact answer.

Algorithms question (Big O): Please explain me in details the order of growth (as a function of N) of the running times of each of the following code fragments:

a)         int sum = 0;

for (int n = N; n > 0; n /= 2)

   for(int i = 0; i < n; i++)

     sum++;

b)         int sum = 0;

for (int i = 1 i < N; i *= 2)

     for (int j = 0; j < i; j++)

          sum++;

c)         int sum = 0;

for (int i = 1 i < N; i *= 2)

for (int j = 0; j < N; j++)

      sum++;

Note: No copy/paste from Google search please. Send me the answer only if you have very clear concept on this

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
Please DONOT attempt this Big O question if you don't know the exact answer. Algorithms question...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT