Question

Let h(n) = n mod 3. Next, let f(n) = n and g(n) = nh(n). What...

Let h(n) = n mod 3. Next, let f(n) = n and g(n) = nh(n). What is the order relationship between f and g?

Please explain with complete sentences!

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

Clearly, the possible value of h(n) = 0, 1 or 2

This means that the possible values of g(n) could be 0, n or 2n.

In all the cases, f(n) = Θ(g(n)) since both f(n) and g(n) grow in the order of n as n increases.

Add a comment
Know the answer?
Add Answer to:
Let h(n) = n mod 3. Next, let f(n) = n and g(n) = nh(n). What...
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