Question
1. Consider the polynomial P(n) of degree k: P(n) = a k n k + a k-1 n k-1 +..+ a 1 n + a
1. Consider the polynomial P(n) of degree k:
P(n) = aknk + ak-1nk-1+..+ a1n + a0. with all ai > 0
Using the definition of (nk), prove that
P(n) (nk).
2. List all the functions below from the lowest to the highest order (in terms of growth). If functions have similar growth () , group them between brackets ([]). Brief justifications are ok.
n 2n nlg(n) ln(n) lg(n) sqrt(n) n2 + lg(n)
en n2 2n-1 lg(lg(n)) n3 (lg(n))2 n! n n4 + 7n6
Consider this algorithm:
a = 0
for i=0 to n
for j=i+1 to n
a = a + 2
The objective is to find the total number N of additions performed by the above algorithm to execute the statement a = a + 2. Inspire yourself from the analysis of the nave sorting algorithm to:
- Express N as a function of n.
- Express the final value of a when the algorithm ends
- Provide the best bound (growth) for N.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started