- Allero ( @Allero@lemmy.today ) 9•7 hours ago
The most beautiful thing about this program is that it would work.
Various bit flips will once lead to all numbers being in the correct order. No guarantee the numbers will be the same, though…
- fallingcats ( @fallingcats@discuss.tchncs.de ) 2•3 hours ago
Those bitflips are probably more likely to skip the section erroneously than waiting for the array to be sorted.
- Allero ( @Allero@lemmy.today ) 1•10 minutes ago
Fair enough! But won’t they flip again to start the program?
- Midnitte ( @Midnitte@beehaw.org ) English6•5 hours ago
Might also take a very long time (or a large amount of radiation).
- Swedneck ( @Swedneck@discuss.tchncs.de ) 15•9 hours ago
import yhwh def interventionSort(unsortedList): sortedList = yhwh.pray( "Oh great and merciful Lord above, let thine glory shine upon yonder list!", unsortedList ) return sortedList
- porous_grey_matter ( @porous_grey_matter@lemmy.ml ) 4•7 hours ago
Camelcase in python, ew, a fundamentalist would do that
- TheOakTree ( @TheOakTree@lemm.ee ) 6•8 hours ago
Hello programmers…
I recently took a course that went through basic python, C, and C++.
I had a hard time implementing various forms of sorting functions by hand (these were exercises for exam study). Are there any resources you folks would recommend so that I can build a better grasp of sorting implementations and efficiency?
- 90s_hacker ( @90s_hacker@reddthat.com ) 4•7 hours ago
Skiena’s Algorithm design manual is very widely recommended for learning algorithms, I’ve also heard good things about A common sense guide to algorithms and data structures. Skiena’s also has video lectures on YouTube if you prefer videos.
From what I’ve seen, a common sense guide seems to be more geared towards newer programmers while Skiena assumes more experience. Consequently, Skiena goes into more depth while A common sense guide seems to be more focused on what you specifically asked for. algorithm design manual
- TheOakTree ( @TheOakTree@lemm.ee ) 1•7 hours ago
Thank you, awesome! I will definitely check out this material :)
- state_electrician ( @state_electrician@discuss.tchncs.de ) 69•14 hours ago
My favorite is StalinSort. You go through the list and eliminate all elements which are not in line.
- 1984 ( @1984@lemmy.today ) 18•12 hours ago
This is the algoritm I use at work.
- lemmydividebyzero ( @lemmydividebyzero@reddthat.com ) English12•12 hours ago
Is it thread safe?
- Ephera ( @Ephera@lemmy.ml ) 21•12 hours ago
I hear, it actually significantly increases the chance of the miracle occurring when you pass the array into multiple threads. It’s a very mysterious algorithm.
- BatmanAoD ( @BatmanAoD@programming.dev ) 76•17 hours ago
Reminds me of quantum-bogosort: randomize the list; check if it is sorted. If it is, you’re done; otherwise, destroy this universe.
- Zaphod ( @Zaphod@discuss.tchncs.de ) 17•11 hours ago
The creation and destruction of universes is left as an exercise to the reader
- BatmanAoD ( @BatmanAoD@programming.dev ) 2•4 hours ago
Creation is easy, assuming the many-worlds interpretation of quantum mechanics!
- SubArcticTundra ( @SubArcticTundra@lemmy.ml ) 8•16 hours ago
What library are you using for that?
- SkaveRat ( @SkaveRat@discuss.tchncs.de ) 7•12 hours ago
In Python you just use
import destroy_universe
- jcg ( @jcg@halubilo.social ) 18•16 hours ago
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
- Swedneck ( @Swedneck@discuss.tchncs.de ) 6•9 hours ago
that explains why it took god 7 days to make the universe
- onlinepersona ( @onlinepersona@programming.dev ) 1•8 hours ago
We still suffer from the runtime errors that could’ve been caught at compilation time.
- frezik ( @frezik@midwest.social ) 1•16 hours ago
Since randomizing the list increases entropy, it could theoretically make your cpu cooler just before it destroys the universe.
- ChaoticNeutralCzech ( @ChaoticNeutralCzech@feddit.org ) English33•17 hours ago
- MajorHavoc ( @MajorHavoc@programming.dev ) 20•16 hours ago
// portability
Gave me the giggles. I’ve helped maintain systems where this portable solution would have left everyone better off.
- aeharding ( @aeharding@vger.social ) 6•14 hours ago
Shameless plug for my sort lib
edit: Looking at my old code it might be time to add typescript, es6 and promises to make it ✨ p r o d u c t i o n r e a d y ✨