Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Landau notation (ide) tools support

It is good idea to have impotant information during developing like Landau notation to know functions's time costs. So it should be documented in sources isn't it?

I'm looking for tools that can calculate it.

like image 505
Jeriho Avatar asked Dec 22 '25 07:12

Jeriho


1 Answers

In the general case, the asymptotic complexity of an arbitrary algorithm is undecidable, by Rice's theorem.

But in practice, you can often make a good guess by repeatedly running the algorithm on various inputs (of sizes spanning several orders of magnitude), recording actual CPU time, and fitting a curve. (You should throw out data points with very short runtimes, since these will be dominated by noise. Also, on JITed runtimes like the Java Virtual Machine, make sure to run the function for a while before starting the timing, to make sure the VM has warmed up.)

like image 115
Mechanical snail Avatar answered Dec 23 '25 21:12

Mechanical snail



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!