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 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.
while (s++ = t++);