For instance: I can write a sort in any language because I carry this little gem around in my head:
quicksort [] = []
quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater)
where
lesser = filter (< p) xs
greater = filter (>= p) xs
Bird & Wadler is a great introduction to functional programming as well as algorithms and efficient data structures.http://www.amazon.com/Introduction-Functional-Programming-In...
(blimey, I had no idea my old copy was now so valuable!)
Richard Bird - Pearls of Functional Algorithm Design http://www.amazon.com/Pearls-Functional-Algorithm-Design-Ric...
Christian Queinnec - Lisp in Small Pieces http://www.amazon.com/Lisp-Small-Pieces-Christian-Queinnec/d...