Question
For each code write the time complexity.
1. [20pts]: For each of the following pieces of code, write down the time complexity that the code will run in, choosing from o(1), o(log n), o(n), o(n log n), o(n o (n): def something (n) for i in range (n) for j in range (5) for i in range (n) print (i j) return n for i in range (n) something (n) Big O Big O for i in range (521313 2213* 11) for i in range (n) for j in range (i i i) for j in range (n n/3, 9) for y in range (j i) print (i j) print (i, j, y) Big-O: Big-O:
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. 120pts]: For each of the following pieces of code, write down the time complexity that the code will run in, choosing from1.O(n)

2. O(n)

3.O(n2)

4. O(1)

Add a comment
Know the answer?
Add Answer to:
For each code write the time complexity. For each of the following pieces of code, write...
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