3 ms·
I'm glad to see more classes like this come online. I think its a bit of a shame that the material (of the book) focuses so much on Java, however. The algorithm
by ghc 13y ago
I'm glad to see more classes like this come online. I think its a bit of a shame that the material (of the book) focuses so much on Java, however. The algorithms classes I took in college focused a lot on math, logic and proofs. It took me a long time to understand exactly why; I thought we'd be learning L1 cache hacks and register tricks in Assembly or C. But the technology used to implement the algorithms changes a lot faster than the algorithms themselves, and the details of the best optimizations are different for just about every language. I now think it's far more important to have a solid grounding in problem decomposition and theory than it is to understand the intricacies of efficient algorithm designs for a specific language.
If you feel like I do, there are two books in particular that come to mind in that their content transcends the normal teaching curriculum and they both force you to think long and hard about how the authors came up with these fantastic little optimizations. I personally learned a lot from trying to reconstruct the thought process that must have led up to some of the algorithms implemented therein.
The first book is called Pearls of Functional Algorithm Design, and while it focuses on implementation in Haskell, you don't need to be a functional programming expert to get a lot out of the book.
The second book is called Foundations of Multidimensional and Metric Data Structures, and while the name might scare some away, it has a lot of interesting algorithms and accompanying research paper references so you can go off and explore. It took me several years to make my way through it completely, but I have gained a much better understanding of algorithms (and data structures!) that deal with more complex topics (such as computer vision).
There's one book I'd like to call out, as well. Introduction to Algorithms could be so much better than it is. It has all the right ingredients for a fantastic introduction to algorithms, but the way its written had most people in my algorithms class, myself included, bored beyond belief.
Just my 2 cents.
- plinkplonk 13y ago"the material (of the book) focuses so much on Java," This isn't really true. There is one section of the book (section 2 in Chapter 1 iirc) that details the minimalistic subset of java used, and there are a total of four interfaces used in the book (Comparable, Comparator, Iterable, Iterator) and each is explained very clearly. The code uses no inheritance, no fancy types, no design patterns. Input and Output are abstracted away by author provided classes with the minimal methods required to read in and write out strings, ints etc (vs struggling with BufferedOutputStreams or whatever in mainstream java). In other words, Java is used as a very minimalistic pseudocode. (e.g http://algs4.cs.princeton.edu/11model/Shuffle.java.html http://algs4.cs.princeton.edu/11model/Shuffle.java.html). It is almost python like. A simple imperative language is best to learn the basics of algorithms in. You can't appreciate functional datastructures before you thoroughly understand imperative ones.. Something like SML may have been better, but the minimal 'loops + classes-as-structs-and-no-java-heavy-machinery' approach in the book works fine. There are certainly valid criticisms of the book to be made, but an 'excessive focus on Java' is not one of them imo (and I don't even like Java fwiw). PS: Thank You for your book reccommendations. The "Metric Data Structures" book looks really interesting. Ordered.