Not my problem sort - Infosec.Pub

Reminds me of quantum-bogosort: randomize the list; check if it is sorted. If it is, you’re done; otherwise, destroy this universe.
Guaranteed to sort the list in nearly instantaneous time and with absolutely no downsides that are capable of objecting.
Except you missed a bug in the “check if it’s sorted” code and it ends up destroying every universe.
There’s a bug in it now, that’s why we’re still here.

You still have to check that it’s sorted, which is O(n).

We’ll also assume that destroying the universe takes constant time.

In the universe where the list is sorted, it doesn’t actually matter how long the destruction takes!
It actually takes a few trillion years but its fine because we just stop considering the “failed” universes because they will be gone soon™ anyway.
Eh, trillion is a constant

We’ll also assume that destroying the universe takes constant time.

Well yeah just delete the pointer to it!

What library are you using for that?

In Python you just use

import destroy_universe
Since randomizing the list increases entropy, it could theoretically make your cpu cooler just before it destroys the universe.
Instead of destroying the universe, can we destroy prior, failed shuffle/check iterations to retain o(1)? Then we wouldn’t have to reload all of creation into RAM.
Delete prior iterations of the loop in the same timeline? I’m not sure there’s anything in quantum mechanics to permit that…

The creation and destruction of universes is left as an exercise to the reader

Creation is easy, assuming the many-worlds interpretation of quantum mechanics!