stepbystep-timsort
stepbystep-timsort copied to clipboard
Line of code takes 12 seconds off runtime.
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.
I want to apply it, but the project as the document code, it should not applied the last code only.
Then you should apply the code to all the documents that use the stack.