sorting times

Scott David Daniels Scott.Daniels at Acm.Org
Fri Mar 26 15:16:06 EST 2004


Matt wrote:

> I have an assignment that requires me to analyse the time complexities
> of bubble sort and quick sort.
> I don't want any help - but would like to know if people consider the
> following times to be 'normal':
Yup, might be.  Do what your professor asked, and look at the times as
a function of file length (try 1000, 2000, ... 10000), and plot the
results.  If everything is too fast to measure, increase the size a bit.

> I implemented both algorithms in C , as bubble sort used to take 8
> hours.
Actually, just use the python implementations for both -- you are
supposed to be looking at time complexity, not speed.  At suitably
smaller sizes, you'll still be able to watch your program finish.
-- 
-Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-list mailing list