HACKER Q&A
📣 highwayman47

What's Your Favorite Algorithm?


What's Your Favorite Algorithm?


  👤 Rounin Accepted Answer ✓
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.

👤 tothrowaway
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.

👤 john_the_writer
I have loved this one for years

while (s++ = t++);


👤 graderjs
I’m partial to LZ77 so simple and elegant and skiplist: simple but powerful