Question: Problem 1 . ( 2 5 points ) For each of the following functions, indicate how much the function s value will change if its
Problem points
For each of the following functions, indicate how much the functions value will change if its
argument is increased fourfold.
a b n c n
d n
e
n
Problem points
List the following functions according to their order of growth from the lowest to the highest:
nlogn
n
n
n
ln
n
n
Problem points
Consider the following algorithm.
ALGORITHM NoNameAn
Input: An array An of n real numbers
minval A; maxval A
for i to n do
if Ai minval
minval Ai
if Ai maxval
maxval Ai
return maxval minval
a What does this algorithm compute?
b What is its basic operation?
c How many times is the basic operation executed?
d What is the efficiency class of this algorithm?
Problem points
Consider the following recursive algorithm for computing the sum of the first n cubes:
Sn n
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
