What are some must-know algorithms?

10 points by _dt47 ↗ HN
I'm fairly advanced in Java, and i want to learn some algorithms. Any suggestions?

6 comments

[ 2.2 ms ] story [ 23.4 ms ] thread
The best algorithm I know is to use the appropriate built-in classes, and then do something clever only if performance is an issue.

In my opinion knowing the popular and "best practice" design patterns is more important than knowing a lot of algorithms. Although I suppose they overlap a bit.

(comment deleted)
(comment deleted)
Here are a few (in no particular order):

- Dynamic Programming

- Graph algorithms: Traversal (A*), shortest path (Dijkstra, Bidirectional, Floyd–Warshall), minimum spanning tree

- Recursive Search Techniques

- Search Trees (binary, n-ary, splay, AVL)

- Suffix trees

- Parsing using regex

- Sorting (with all the variations)

- Hashing

- Greedy Algos

- Divide and conquer

- Genetic algorithms

There are a few other algorithms that are must-know too. I guess that would depend on the domain we are in (computer vision, machine learning, NLP, etc).