ArrayV icon indicating copy to clipboard operation
ArrayV copied to clipboard

The shatter sorting cannot sort correctly in random input

Open pystraf opened this issue 1 year ago • 6 comments

The shatter sorting cannot sort correctly in random input. But the simple shatter sorting and the immediate shatter sorting can.

pystraf avatar Aug 18 '24 06:08 pystraf

The video:

https://github.com/user-attachments/assets/b9c87f07-9a86-4637-8cd7-82fa2519feb7

pystraf avatar Aug 18 '24 06:08 pystraf

The index sort is incorrect, too. I recommend to remove them.

pystraf avatar Aug 20 '24 10:08 pystraf

But I think the pattern after shatter sorting is quite beautiful

pystraf avatar Aug 20 '24 10:08 pystraf

shatter sort and index sort both assume the array is composed of elements from a linear distribution, and they break if they don't find such a distribution. they're not broken, they just operate on specific kinds of inputs

amari-calipso avatar Aug 20 '24 10:08 amari-calipso

the circle merge sorting also cannot work correctly when the array length is not 2^k.

https://github.com/user-attachments/assets/295aa565-e80d-4f8e-9232-b9d9cc82b449

pystraf avatar Aug 21 '24 11:08 pystraf

@Gaming32 @thatsOven

pystraf avatar Aug 25 '24 13:08 pystraf