Ask HN: What's your favorite elegant/beautiful algorithm?
61–70 of 507 posts
Re: Ask HN: What's your favorite elegant/beautiful algorithm?
#62Re: Ask HN: What's your favorite elegant/beautiful algorithm?
#63Re: Ask HN: What's your favorite elegant/beautiful algorithm?
#64Euclid's GCD algorithm, and Russian peasant multiplication.
I never heard about "Russian peasant multiplication" before. When I read it, I thought you were referring to Karatsuba multiplication. As it turns out, you didn't. http://mathforum.org/dr.math/faq/faq.peasant.html https://en.wikipedia.org/wiki/Karatsuba_algorithm
Re: Ask HN: What's your favorite elegant/beautiful algorithm?
#65Diffie–Hellman. I know that cryptography can get much fancier and more clever, but Diffie–Hellman took a concept my intuition told me was impossible and showed that it's possible in a really simple, elegant way. Learning about it was the first time I realized how beautiful the math behind computer science is. It's also a great insight into just how fundamental the concept of computational complexity is.
I agree but, to be fair, the key ingredient ("discrete logarithms are hard") is not simple at all.
Re: Ask HN: What's your favorite elegant/beautiful algorithm?
#66Diffie–Hellman. I know that cryptography can get much fancier and more clever, but Diffie–Hellman took a concept my intuition told me was impossible and showed that it's possible in a really simple, elegant way. Learning about it was the first time I realized how beautiful the math behind computer science is. It's also a great insight into just how fundamental the concept of computational complexity is.
So true. Securely exchanging keys is an abstract concept until you see those paint colors mixing!
Re: Ask HN: What's your favorite elegant/beautiful algorithm?
#67I like Dijkstra's algorithm for finding the shortest path between two nodes in a graph. It's not so much that it is "beautiful", but it is a remarkably simple algorithm that a human can follow manually. The reason it is efficient is easily understood (it's easy to see how we are able to "finalize" nodes because it's obvious there is no shorter path to that node), and it takes what would otherwise be a complicated tas…
Re: Ask HN: What's your favorite elegant/beautiful algorithm?
#68I like Dijkstra's algorithm for finding the shortest path between two nodes in a graph. It's not so much that it is "beautiful", but it is a remarkably simple algorithm that a human can follow manually. The reason it is efficient is easily understood (it's easy to see how we are able to "finalize" nodes because it's obvious there is no shorter path to that node), and it takes what would otherwise be a complicated tas…
Re: Ask HN: What's your favorite elegant/beautiful algorithm?
#69[0] http://www.drdobbs.com/jvm/an-algorithm-for-compressing-spac...