5 ms·
Sorting Algorithms in C
- transitivebs 7y agoThe irony in these two posts being side-by-side is kind of awesome https://twitter.com/transitive_bs/status/1222772644212363267?s=20 https://twitter.com/transitive_bs/status/1222772644212363267...
- inciampati 7y agoWhat's amazing to me is that sorting is still an open problem with active research producing new algorithms. It gets really tricky when you want to use parallel architectures to speed it up. Case in point: ips4o, https://github.com/SaschaWitt/ips4o https://github.com/SaschaWitt/ips4o
- thechao 7y agoSo is printing floating point numbers: https://cseweb.ucsd.edu/~lerner/papers/fp-printing-popl16.pdf https://cseweb.ucsd.edu/~lerner/papers/fp-printing-popl16.pd.... That paper was published in POPL -- one of the most distinguished conferences in all of CS.
- thestoicattack 7y agoSo I was all set to bash include/data-swap.c for allocating on the heap every time you need to swap memory. Turns out that gcc can optimize out that temporary, and it ends up the same as std::swap. But if we use operator new/delete instead of std::malloc the optimization doesn't take place: https://godbolt.org/z/vtxqD2 https://godbolt.org/z/vtxqD2
- AbacusAvenger 7y agoNeat find. Clang seems to be consistent about it in all 3 cases though: https://godbolt.org/z/iH7ydo https://godbolt.org/z/iH7ydo
- gshdg 7y agoGee, this brings me back to second semester computer science class.
- ericwood 7y agoTangentially related: what resources would y'all recommend for learning modern-ish C? I'm planning out a microcontroller project and reading through avr-libc I'm realizing my C skills have completely atrophied since college a decade ago. There seems to be a lot of outdated information out there, and honestly it's tough for me to judge the quality of what I'm reading. Any advice is greatly appreciated!