MHN

Ask HN: What's your favorite elegant/beautiful algorithm?

733 points by algobuddy·2966 days ago·Show in HN
Add a comment on Hacker News →
2 of 491 comments
  1. Fenwick Tree (Binary Indexed Tree)

  2. I want to point out that this actually makes a great interview question.

    I've had really good results asking this. I find it's a great question, because it allows the candidate to show off their knowledge, and use some knowledge that they likely prepared for ahead of time. I also like it because sometimes I get to learn something really interesting from the candidate.

    It's also an easy way to filter people when they can't name even one algorithm, or their favorite is "that sorting algorithm"