[Year 12 SofDev] Sorting Algorithms, T

Selina Dennis selina at dennis.net.au
Mon Jul 11 23:39:49 AEST 2016


Hi everyone,

 

I was playing around with the Python package "timeit" as part of teaching
sorting algorithms and thought I'd send it to the list in the spirit of
sharing. I don't suggest running anything bigger than n=50000 unless you're
willing to wait patiently!  (For interest, n=50,000 takes 71 seconds using
selection sort, 0.11 seconds using quicksort)

 

Even if you're not teaching Python, if you have Python installed on your
computer you can use it to play around with different n values to
demonstrate algorithm complexity in relation to sort time.

 

I've attached the code as a zip file in case .py files are filtered. 

 

Thanks,

 

Selina Dennis

Strathmore Secondary College

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.edulists.com.au/pipermail/sofdev/attachments/20160711/04cdd67b/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sampleSorts.zip
Type: application/x-zip-compressed
Size: 1758 bytes
Desc: not available
Url : http://www.edulists.com.au/pipermail/sofdev/attachments/20160711/04cdd67b/sampleSorts.zip 


More information about the sofdev mailing list