Question

Q-1: Given the following code fragment, what is its Big-O running time? test = 0 for...

Q-1: Given the following code fragment, what is its Big-O running time?

test = 0

for i in range(n):

            for j in range(n):

                        test= test + i *j

Q-2: Given3 the following code fragment what is its Big-O running time?

for i in range(n):

            test=test+1

for j in range(n):

            test= test - 2

Q-3: Given the following code fragment what is its Big-O running time?

i = n

while i > 0:

            k=2+2

            i = i // 2

1 0
Add a comment Improve this question Transcribed image text
Answer #1

Here is the answer..

testo for ein range (s): for j in range(n) - test = lest + 1 tj nxn nxo 1+0+0+000 3 if (1) for &(n)= ant+n+1 flu)= 0 (n) a in

If you have any doubts please COMMENT...

If you understand the answer please give THUMBS UP...

Add a comment
Know the answer?
Add Answer to:
Q-1: Given the following code fragment, what is its Big-O running time? test = 0 for...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
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