[Tutor] stable algorithm
Alan Gauld
alan.gauld at btinternet.com
Sun Dec 14 20:21:50 CET 2008
"spir" <denis.spir at free.fr> wrote
>> And how can i write single test which will tell me execution time
>> of
>> this algorithm?
> First, google will give you tons of links on the topic.
> time.time() returns present time in ms
You could also use the python profiler which will give you timing
information for just the sort function itself. That may be more
useful if trying to prove the linearity of your sort rather than of
the overall program including data production etc.
You should be able to write a function to generate a list of N
random numbers easily enough.... Now write a loop to do
that for 2,20,200,200 and 200,000 numbers.
Tabulate the results.
Alan G
More information about the Tutor
mailing list