Can someone explain to me why this is true. I heard a professor mention this is his lecture
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The two notions are orthogonal.
You can have worst case asymptotics. If
f(n)denotes the worst case time taken by a given algorithm with inputn, you can have eg.f(n) = O(n^3)or other asymptotic upper bounds of the worst case time complexity.Likewise, you can have
g(n) = O(n^2 log n)whereg(n)is the average time taken by the same algorithm with (say) uniformly distributed (random) inputs of sizen.Or you can have
h(n) = O(n)whereh(n)is the average time taken by the same algorithm with particularly distributed random inputs of sizen(eg. almost sorted sequences for a sorting algorithm).Asymptotic notation is a “measure”. You have to specify what you want to count: worst case, best case, average, etc.
Sometimes, you are interested in stating asymptotic lower bounds of (say) the worst case complexity. Then you write
f(n) = Omega(n^2)to state that in the worst case, the complexity is at leastn^2. The big-Omega notation is opposite to big-O:f = Omega(g)if and only ifg = O(f).