stepbystep-timsort icon indicating copy to clipboard operation
stepbystep-timsort copied to clipboard

Line of code takes 12 seconds off runtime.

Open ahitt6345 opened this issue 9 years ago • 2 comments

Apparently, this tim sort keeps merging uneven runs. Adding this code makes sure it prioritizes Even Runs. I ran this timsort(before edit) on 1000000 Integers in a random order. It took a whopping 12 SECONDS vs. The normal merge sort's 2 seconds. Now, it's run time is improved to 0.9 seconds.

ahitt6345 avatar Feb 02 '16 01:02 ahitt6345

I want to apply it, but the project as the document code, it should not applied the last code only.

bellbind avatar May 31 '16 00:05 bellbind

Then you should apply the code to all the documents that use the stack.

ahitt6345 avatar May 31 '16 21:05 ahitt6345