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
(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? Eplain why or why not.
(b) For each of the following pairs of functions f() and g(), determine if f() = O(g()), g() = O(f()), or both, and eplain your answers (reminder: is always non-negative):
i. f() = 2, g() =
– 10
ii. f() = 2 + - 100, g() = 10 + 100
iii. f() = 100, g() = 2
iv. f() = 2, g() =
x
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
