News for hackers. Stuff that matters.
Re:Ask HN: What's Your Favorite Algorithm? by john_the_writer on Friday November 11, 2022 @02:54AM (#33558270)
I have loved this one for years

while (s++ = t++);

Re:Ask HN: What's Your Favorite Algorithm? by Rounin on Friday November 11, 2022 @04:09AM (#33558602)
Binary search and similar forms of successive approximation. It can be used to solve such a wide array of problems given just a minimal amount of information.
Re:Ask HN: What's Your Favorite Algorithm? by highwayman47 on Friday November 11, 2022 @04:25AM (#33558672)
can you please ELI5?
Re:Ask HN: What's Your Favorite Algorithm? by graderjs on Friday November 11, 2022 @06:15AM (#33559341)
I’m partial to LZ77 so simple and elegant and skiplist: simple but powerful
Re:Ask HN: What's Your Favorite Algorithm? by tothrowaway on Saturday November 12, 2022 @01:01AM (#33570423)
The Hungarian algorithm. It solves the assignment problem (the optimal way to assign workers to tasks given their completion time of each task). The assignment problem looks hopelessly O(n!), but by some magic, the algorithm can solve it in polynomial time.