0x4E4F@infosec.pub to Programmer Humor@programming.devEnglish · 2 years agoNot my problem sortinfosec.pubimagemessage-square17linkfedilinkarrow-up15arrow-down10
arrow-up15arrow-down1imageNot my problem sortinfosec.pub0x4E4F@infosec.pub to Programmer Humor@programming.devEnglish · 2 years agomessage-square17linkfedilink
minus-squareBatmanAoD@programming.devlinkfedilinkarrow-up1·2 years agoReminds me of quantum-bogosort: randomize the list; check if it is sorted. If it is, you’re done; otherwise, destroy this universe.
minus-squarexmunk@sh.itjust.workslinkfedilinkarrow-up1·2 years agoGuaranteed to sort the list in nearly instantaneous time and with absolutely no downsides that are capable of objecting.
minus-squarefrezik@midwest.sociallinkfedilinkarrow-up0·2 years agoYou still have to check that it’s sorted, which is O(n). We’ll also assume that destroying the universe takes constant time.
minus-squareBatmanAoD@programming.devlinkfedilinkarrow-up1·2 years agoIn the universe where the list is sorted, it doesn’t actually matter how long the destruction takes!
minus-squaregroet@feddit.orglinkfedilinkEnglisharrow-up0·2 years agoIt actually takes a few trillion years but its fine because we just stop considering the “failed” universes because they will be gone soon™ anyway.
minus-squareSubArcticTundra@lemmy.mllinkfedilinkarrow-up0·2 years agoWhat library are you using for that?
minus-squarejcg@halubilo.sociallinkfedilinkarrow-up0·2 years agois-sorted and a handful of about 300 other npm packages. Cloning the repo and installing takes about 16 hours but after that you’re pretty much good for the rest of eternity
minus-squareSwedneck@discuss.tchncs.delinkfedilinkarrow-up0·2 years agothat explains why it took god 7 days to make the universe
minus-squareonlinepersona@programming.devlinkfedilinkarrow-up0arrow-down1·2 years agoWe still suffer from the runtime errors that could’ve been caught at compilation time. Anti Commercial-AI license
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.
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
What library are you using for that?
is-sorted and a handful of about 300 other npm packages. Cloning the repo and installing takes about 16 hours but after that you’re pretty much good for the rest of eternity
that explains why it took god 7 days to make the universe
We still suffer from the runtime errors that could’ve been caught at compilation time.
Anti Commercial-AI license