Hungarian folk dance sorting algorithm
-
-
@ben_lubar This is not quicksort. Okay maybe the last part is quicksort. No. No this is just weird. Is this TimSort or something?
-
@Gribnit said in Hungarian folk dance sorting algorithm:
@ben_lubar This is not quicksort. Okay maybe the last part is quicksort. No. No this is just weird. Is this TimSort or something?
Sure it is. The dancers just uses an idiosyncratic partition algorithm. The pivot and the element being tested start at opposite ends of the array. When the comparison shows that they are in the wrong order, they swap. The next element to be tested is the next element closer to the pivot, which results in the iteration direction reversing after every swap.
-
@MZH The comparison operation is rather time consuming.
-
@HardwareGeek said in Hungarian folk dance sorting algorithm:
@MZH The comparison operation is rather time consuming.
Now I want to see slowsort implemented to see if anyone will still be standing at the end.
-
@ben_lubar That took fucking forever...
-
@Tsaukpaetra said in Hungarian folk dance sorting algorithm:
That took fucking forever...
But could have been parallelised. So much more thigh slapping at the same time!
-
https://www.youtube.com/watch?v=CmPA7zE8mx0
TIL Shell sort will turn your list into a circular buffer at the end.