Suppose I have, “Heap Sort” method which its complexity time is O(nlogn). When I measure the execution time of this method upon 1000000 inputs I got 0.375770669 seconds. How can I calculate the execution time of this method theoretically?
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.
There is no way to calculate this theoretically. It depends on many factors such as:
Even if you knew all of those, the calculation would essentially be a forensic simulation of the Java JIT compiler and hardware execution. It is far too complicated to contemplate.
The best you can reasonably expect to achieve in terms of a theoretical measure of “speed” is to count abstract operations at the source-code level. Even drilling down and counting bytecodes executed is probably too difficult to be practical.
Basically, you can’t.