Question: 1 . Find a tight upper bound for f ( n ) = n 4 + 1 0 n 2 + 5 . Write your
Find a tight upper bound for f n n n Write your answer here: points
Prove your answer by giving values for the constants c and n Choose the smallest integer value
possible for c points
Find an asymptotically tight bound for f n n n Write your answer here: points
Prove your answer by giving values for the constants c c and n Choose the tightest integer
values possible for c and c points
Is nepsi Omega n Circle your answer: yes no points
If yes, prove your answer by giving values for the constants c and n Choose the smallest integer
value possible for c If no derive a contradiction. points
Write the following asymptotic efficiency classes in increasing order of magnitude.
On On O O n lgn On O n On O lg n O n n O n lgn points each
Determine the largest size n of a problem that can be solved in time t assuming that the algorithm
takes fn milliseconds. Write your answer for n as an integer. points each
a fn n t second
b fn n lg n t hour
c fn n t hour
d fn n t day
e fn n t minute
Suppose we are comparing two sorting algorithms and that for all inputs of size n the first algorithm
runs in n seconds, while the second algorithm runs in n lg n seconds. For which integer
values of n does the first algorithm beat the second algorithm? points
CS Homework b: Analysis of Algorithms
Explain in detail how you got your answer or paste code that solves the problem point:
Give the complexity of the following methods. Choose the most appropriate notation from among Omicron
Theta and Omega points each
int functionint n
int count ;
for int i n ; i n; i
for int j ; j n; j
count;
return count;
Answer:
int functionint n
int count ;
for int i ; i i i n; i
count;
return count;
Answer:
int functionint n
int count ;
for int i ; i n; i
for int j ; j n; j
for int k ; k n; k
count;
return count;
Answer:
int functionint n
int count ;
for int i ; i n; i
for int j ; j n; j
count;
break;
return count;
Answer:
CS Homework b: Analysis of Algorithms
int functionint n
int count ;
for int i ; i n; i
count;
for int j ; j n; j
count;
return count;
Answer:
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
