(a) Suppose one of two sorting algorithms (Algorithm A) works twice as fast in sorting 10 element-lists...
Fantastic news! We've Found the answer you've been seeking!
Question:
(a) Suppose one of two sorting algorithms (Algorithm A) works twice as fast in sorting 10 element-lists as the other (Algorithm B). Is that information enough to conclude that Algorithm A is the best way to sort lists in general? Explain why or why not.
(b) For each of the following pairs of functions f(x) and g(x), determine if f(x) = O(g(x)), g(x) = O(f(x)), or both, and explain your answers (reminder: x is always non-negative):
i. f(x) = 2x, g(x) =– 10
ii. f(x) = x2 + x - 100, g(x) = 10x + 100
iii. f(x) = 100, g(x) = 2x
iv. f(x) = 2x, g(x) =
Related Book For
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest
Posted Date: