Chapter 3: Q19E (page 216)
Determine whether each of the functions \({2^{n + 1}}\)and \({2^{2n}}\)is \(O({2^n})\).
Short Answer
We have determined that the function \(f(n) = {2^{n + 1}}\) is \(O({2^n})\)and \(g(n) = {2^n}\) is not \(O({2^n})\).
Chapter 3: Q19E (page 216)
Determine whether each of the functions \({2^{n + 1}}\)and \({2^{2n}}\)is \(O({2^n})\).
We have determined that the function \(f(n) = {2^{n + 1}}\) is \(O({2^n})\)and \(g(n) = {2^n}\) is not \(O({2^n})\).
All the tools & learning materials you need for study success - in one app.
Get started for freeCompare the number of comparisons used by the insertion sort and the binary insertion sort to sort the list 7, 4, 3, 8, 1, 5, 4, 2.
Give a Big-O estimate of the product of first n odd positive integers.
Suppose that f(x) is O (g(x)) where f and g are increasing and unbounded functions. Show that logโf(x)โ is O (logโg(x)โ).
Devise an algorithm to compute xn, where xis a real number and nis an integer. [Hint:First give a procedure for computing xnwhen nis nonnegative by successive multiplication by x, starting with 1. Then extend this procedure, and use the fact that xโn=1/xnto compute xnwhen nis negative.]
Show that if there were a coin worth 12 cents, the greedy algorithm using quarters, 12 - cent coins, dimes, nickels, and pennies would not always produce change using the fewest coins possible
What do you think about this solution?
We value your feedback to improve our textbook solutions.