Question

Find Big-O notation for the following algorithm:

int function9(int n) { int ij for (i-0; in; i++) for (0; j<n; j++ if (j1) break return j; }

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

Here is the answer..

Gien: nt fondtion nt n) break Big-O rotation is 1 outer loop execytas h-Tmes Tha 1 tme mre loap tself eneates b Couse when et

If there is no break statement in if condition the the Big-O notation for the function is O(n)

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:
Find Big-O notation for the following algorithm: int function9(int n) { int ij for (i-0; in;...
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