| ▲ | twright0 19 hours ago | |
The obvious implementation of bubble sort does not have a "god-view", it looks at pairs of adjacent elements and swaps them if they're out of order. The only global state is whether any swap happened on a single pass, which is equivalent to, in the inverted approach, some system for letting all the cells decide if they're done swapping (necessary to actually returning a sorted list). You can write a bubble-sort-ish kind of thing that tolerates immovable elements or errors in comparison but - I cannot emphasize this enough - bubble sort itself cannot. Anything you say about a re-implementation of bubble sort to tolerate such a thing is not a statement about bubble sort but rather about the thing you implemented that kind of looks like bubble sort. I think I found the paper in question (https://arxiv.org/abs/2401.05375) and it is not supporting these claims about bubble sort at all (not going to try to dig in on the others right now). I cannot find a coherent interpretation of this paper that describes a sorting algorithm that is correct against arbitrary inputs and is also reasonably called "bubble sort". | ||