Skip to content
Advertisement

Tag: mergesort

Mergesort with Python

I couldn’t find any working Python 3.3 mergesort algorithm codes, so I made one myself. Is there any way to speed it up? It sorts 20,000 numbers in about 0.3-0.5 seconds Answer You can initialise the whole result list in the top level call to mergesort: Then for the recursive calls you can use a helper function to which you

Advertisement