A program is written in 3 stages where the first stage is of O(n log n) , the second stage is of O(n^2)
which is based on the result of the first stage, and the third stage is of O(n). What will be asymptotic complexity of the entire program?
Answers
Answer:
fjfjfjdjdjfkkfzgz
Explanation:
cjcjchcjcjcjfjdshgshzgjxsxhdhmdhdj bcdefghijklmnop1rstuv
Concept Introduction:-
Algorithm comparisons are based on asymptotic complexity.
Given Information:-
We have been given that A program is written in stages where the first stage is of , the second stage is of which is based on the result of the first stage, and the third stage is of .
To Find:-
We have to find that the asymptotic complexity of the entire program.
Solution:-
According to the problem
. To see why, note that if and only if there exist positive constants and such that for all , which holds if and only if
By cancelling out an from the numerator and denominator, we can rewrite equation (1) as for all . Writing , we see that the last statement is true if and only if for all . But because we know that , we have that as , so cannot be true for all for any constant .
Final Answer:-
The correct answer are cannot be true for all for any constant .
#SPJ2