w0rthy / SortingVisualizer

Program to visualize, audiolize, profile, approximate runtimes for, and anything else related to sorting algorithms
GNU General Public License v3.0
109 stars 13 forks source link

Adding new mergeStrat variant #6

Open ErrorDAR32 opened 4 years ago

ErrorDAR32 commented 4 years ago

see https://github.com/ErrorDAR32/SortingVisualizer for the new variant this variant that i called doubly (any similarity with any other merge sort in existence is purely coincidence) basically divides the merge space into 4 sublists with the help of 3 pointers those four being (in order) the sorted list, the first mergeable list, the workspace, and the second mergeable list, and compares the first items of the last 3 to en up with a merged array.

I tried to comply as much as possible with your style and requirements to integrate the merge variant, but i have probably failed miserably in some pretty stupid way, i had to port the code from python and i dont know that much c++, i also dont know how to compile your project so i couldnt test it properly, if any error can be signaled for correction would be cool, and eventually merge the variant if you like it would be cooler!

w0rthy commented 4 years ago

Hey, do you have the original python version I can look at?

ErrorDAR32 commented 4 years ago

Yes, it is right here. It was part of some sorting challenges i put to myself to make a better merge in place, i may or may not have been inspired by your videos :P