Question

Algorithms question: Please help if you can Find how many times the string “CS3130” will be...

Algorithms question: Please help if you can

  1. Find how many times the string “CS3130” will be printed in each of the following code fragments. Show all the details of calculations; your answer must be a function of n.

(a)

i=0

while i < 2n

      print “CS3130”

      i = i+2

     

(b)

i=0

while i < n

    for j = 0 to n

         print “CS3130”

    i = i+1

(c)

for i = 0 to n

    for j = 0 to i

         print “CS3130”

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
Algorithms question: Please help if you can Find how many times the string “CS3130” will be...
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