Archive of Interesting Code

· ·

Keith Schwarz, lecturer at Stanford, has a nifty collection of various numerical algorithms:

The Archive of Interesting Code is an (ambitious) effort on my part to research, intuit, and code up every interesting algorithm and data structure ever invented. In doing so, I hope both to learn the mathematical techniques that power these technologies and to improve my skills as a programmer.

The examples on this site are in a variety of languages. I generally prefer to use C++ for algorithms, since the STL provides a great framework for expressing algorithms that work on a variety of data types. I code up most data structures in Java, both because the Collections framework allows them to be integrated in seamlessly with other applications and because automatic garbage collection simplifies some of the resource management. Every now and then I’ll find an algorithm or data structure that is best represented in a different language like Haskell, in which case I’ll forgo my usual language conventions.