Earlier quoted context omitted.
For the operation of this algorithm, is there any meaningful difference between destroying the universe and destroying the observer(s)? https://en.wikipedia.org/wiki/Quantum_suicide_and_immortalit... EDIT: If you allow for the objects to spontaneously sort themselves, the runtime is O(1).
Surely O(n) for checking whether it is sorted?
Unconventional Sorting Algorithms
41–50 of 60 posts
Re: Unconventional Sorting Algorithms
#42Quantum bogosort is probably my personal favorite. Randomly permute the input using a quantum source of entropy. If the input is not sorted, destroy the universe. The only universe remaining is one where the input was already sorted. Runs in O(n) time.
def cosmicraysort(list):
while not sorted(list):
passRe: Unconventional Sorting Algorithms
#43for i = 1 to n do for j = 1 to n do if A[i] swap A[i] and A[j
PUSH A[j]; PUSH A[i]; POP A[j]; POP A[i];
Re: Unconventional Sorting Algorithms
#44Re: Unconventional Sorting Algorithms
#45Earlier quoted context omitted.
It's an obvious joke, the point of which is that the Stalin Sort is destructive and doesn't actually get you what you want, and you'd never want to use it.
I think OP gets the joke and is just saying it is in poor taste. Is it particularly different than their example of Hitler-sort burning stuff in an oven on failure? Or Columbine-sort, where the 15 coolest numbers get shot and then the rest of the numbers can get sorted.
Re: Unconventional Sorting Algorithms
#46Earlier quoted context omitted.
You could just destroy all universes to ensure it's sorted in the remaining reality.
I'm confused. What reality is remaining if all universes are destroyed?
Or rather a reality wherein it wasn't sorted doesn't exist anymore.
Re: Unconventional Sorting Algorithms
#47Earlier quoted context omitted.
I'm confused. What reality is remaining if all universes are destroyed?
None, but in it the list is sorted. Or rather a reality wherein it wasn't sorted doesn't exist anymore.
Re: Unconventional Sorting Algorithms
#48Quantum bogosort is probably my personal favorite. Randomly permute the input using a quantum source of entropy. If the input is not sorted, destroy the universe. The only universe remaining is one where the input was already sorted. Runs in O(n) time.
Even without destroying the universe you can sort your list with a quantum source of entropy, just use: def cosmicraysort(list): while not sorted(list): pass
def qisort(list):
qshuffle(list)
if not sorted(list):
kill_observer()
Only in the universe in which th the list is sorted, the user will survive. There might be no such universe, but then the user is no longer waiting on the result.Re: Unconventional Sorting Algorithms
#49Earlier quoted context omitted.
I think OP gets the joke and is just saying it is in poor taste. Is it particularly different than their example of Hitler-sort burning stuff in an oven on failure? Or Columbine-sort, where the 15 coolest numbers get shot and then the rest of the numbers can get sorted.
But if the point is to mock the concept, how would it be considered normalizing anything?
Re: Unconventional Sorting Algorithms
#50Quantum bogosort is probably my personal favorite. Randomly permute the input using a quantum source of entropy. If the input is not sorted, destroy the universe. The only universe remaining is one where the input was already sorted. Runs in O(n) time.