99 of 100 people found the following review helpful:
5.0 out of 5 stars
An elegant book, March 30, 2005
This review is from: Purely Functional Data Structures (Paperback)
Okasaki's slim volume is one of the best expositions on implementing data structures & algorithms in a functional language. After taking an introductory course on functional programming, this would be the book which tells you where to go next.
This book doesn't just present a rehash/rewrite of imperative data structures, only written in a functional language. Instead, Okasaki makes sure to emphasize benefits which only functional programming can bring to the table. For example, many functional data structures can compactly represent not just their current state, but all of their past states as well--a feature called "Persistence". Also, functional newbie programmers might be wondering why lazy vs. strict programming is a big deal, and Okasaki shows clearly where data structures can benefit from either being lazy or being strict.
For the advanced reader, Okasaki also presents several powerful techniques for analyzing the runtime of algorithms, including the so-called "Banker's Method" and the "Physicist's Method" for analyzing amortized algorithms.
I hope that Okasaki comes out with a 2nd edition of this book; there is one missing piece in particular which I really wish he would have included: Although he presents an EXTREMELY lucid description of how to implement Red-Black trees in a functional language, he only presented algorithms for insertion and querying. Of course, deletion from a red-black tree is the hardest part, left here, I suppose, as an exercise to the student. If you want to supply this missing piece yourself, check out a paper by Stefan Kars, "Red-black trees with types", J. Functional Programming 11(4):425-432, July, 2001. It presents deletion routines, but you'll still want to read Okasaki's book first, for unless you're very much smarter than me you won't be able to understand Kars' paper until you read Okasaki's exposition of red black trees.
Finally, this book is not just useful for programmers in functional languages; logic programmers, using prolog or a varient, will also find this book very helpful, because most of the techniques (all of the techniques, really, with the exception perhaps of the lazy programming stuff) can be directly applied in a prolog programming setting as well.
After reading this book and implementing some of the data structures for yourself, you'll be amazed at how fast algorithms can run, even when written in a functional language!
Help other customers find the most helpful reviews
Was this review helpful to you? Yes
No
39 of 45 people found the following review helpful:
4.0 out of 5 stars
Strange choice of implementation languages, November 6, 2006
This review is from: Purely Functional Data Structures (Paperback)
The description of the book says it includes source code in both ML and Haskell. Unfortunately, the body of the text uses ML exclusively, and the Haskell code is banished to an appendix.
I say "unfortunately", because many of the data structures used depend on lazy evaluation, which comes quite naturally to Haskell, and seems to require some sort of non-standard extension in ML.
While the content is good, I wish it would have used Haskell as the primary exposition language.
Help other customers find the most helpful reviews
Was this review helpful to you? Yes
No
28 of 35 people found the following review helpful:
4.0 out of 5 stars
Hash Tables are included, briefly., November 24, 2001
By A Customer
This review is from: Purely Functional Data Structures (Paperback)
A correction to another review: Hash Tables are included, briefly.
Help other customers find the most helpful reviews
Was this review helpful to you? Yes
No