Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

How to estimate if an algorithm performs within the time limits ?

$
0
0

Sometimes, I think so much to come up with an algorithm, then code it well only to find out that it gives a TLE.
How can we estimate whether an algorithm with so-and-so complexity fits well with the input constraints, before starting the coding ?

For eg:
if input is of length 100000 or 10000
and I just want to know, if an O(n^3) solution gives TLE or not.
Generally, the problem states the time to be 1 or 2 seconds.

So, with this kind of information, can we do any estimates on the number of seconds it takes for a large input and get a sense about its TLE outcome before itself without coding and then testing it with the judge ? Please help...


Viewing all articles
Browse latest Browse all 39796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>