Question

I need help with my discrete math problem. can you show me step by step process . Thanks in advance

3. Give a big-O estimate and a pair of witnesses for the number additions used in this segment of an algorithm. t:= 0 for i:=

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

In case of any queries, please revert back.

We need to find Big-O estimate. These type of questions are solved by looking at 1 loop at 1 time.

1. The first loop runs a total of n times.

2. The second loop runs n-i times. This means :-

So, our desired statement runs :- n-1,n-2,n-3..... 1.

So, we need to sum this :-

This convereges to 1 in n-1 steps => (n-1)(n)/2 . So this is O(n^2).

Number of additions is (n-1)(n)/2.

Add a comment
Know the answer?
Add Answer to:
I need help with my discrete math problem. can you show me step by step process...
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