I haven't tried to coded a sort with just one for loop - but with some "spaghetti code", it should be possible (to do a bubble sort with recursive calls are also possible - with only one for loop, but it wasn't what I was thinking about).
But then you are right - it will no longer be a bubble sort, if it is done with "spaghetti code"
Regards, Rene Larsen
posted 9 years ago
You mean a spaghetti sort? That sounds like a new algorithm, which ought to be published