how to find the time complexity ?
Hi ,
how to find the time complexity of an algorithem and when to consider the O(n) O(n2).... and O(logn) O(n log n)... Please provide some need full docs or links (url) to understand. FYI, I have googled for it found some information. But, not able to figure it out. Thanks & Regards, rpittala. 
Here is an article in wikipedia http://en.wikipedia.org/wiki/Time_complexity
I would recommend that you try to understand the subject and then when you have further questions, use the Reportbutton at your posting and ask a Moderator to move this thread to the "Programming" forum. Markus 
Quote:
MIT Opencourseware includes the 600 course that I can recommend. http://ocw.mit.edu/courses/electrica...ideolectures/ 
Its not always simple
To find the complexity of an algorithm can't be done with simple commands or testing the algorithm without understanding the test case and how the algorithm operates. If you were to submit a case of n objects to the algorithm it processes them in "n" time. If you increase this by 2 then it processes in 2N time. The only true way to figure out the complexity is to look at the code. Loops where every "object" that the algorithm is processed is an O(n). You can look for nested loops, if for every object, all n objects are processed, you have an O(n^2). Its very complex and hard to explain, you might want to read the Wikipedia article in full.

All times are GMT 5. The time now is 06:23 PM. 