I understand most of the run times. I can follow why an algorithm is of running time n^2, n or constant - that makes complete and total sense.
What I don't understand is the lovely implementation of the Big Oh. Why and what are my main questions.
So with further research - I have come to understand that the Big Oh notation is a way to describe the 'limiting behavior' of a function. In particular, within the computer science domain, the big Oh notation is used to clarify how algorithms respond (i.e.: their running time or work space required)
On topic with the previous sorting post, in this case we are concerned about the Big Oh notation which refers to the growth rate in regards to their running time.
Ex// If we double the length of the list what happens to the run time
As for as running times are concerned - the hierarchy is as follows:
0(1) <= O(lgn) <= O(n) <= O(n^2) <= O(n^3) <= O(2^n) <= O(n^n)
No comments:
Post a Comment