Quick Book Review - Mastering Algorithms with Perl
Authors: Jon Orwant, Jarkko Hietaniemi & John MacdonaldSummary: Overall, this book explains methods of implementing Algorithms with Perl blending custom techniques with resources available (CPAN) in a "learn by example" approach. It contains 16 great chapters of background, theory, sample code, diagrams, and discussion. It has a good Appendix A (for additional info on algorithms) and a useful ASCII table in Appendix B. If you want to learn good ways to implement specific Algorithms with Perl - Read this book!
Review:
When I heard that O'Reilly was publishing a book on Algorithms in Perl I couldn't wait to get my hands on it. Well last month (Oct 1999) I did and it was great!
The clearly written text contains the usual light, easy-reading tone and occasional humorous elements found in most O'Reilly books. The authors include plenty of pictures and diagrams for those who learn visually (rather then by reciting words out loud). The Perl code within is concise, with comments when necessary, and makes use of the objects when possible. If you plan to read this book you should know Perl because the more advanced level of the code could cause problems for the non-Perl or beginning Perl Programmer. However, to a Perl programmer who is comfortable with the language the code reads clean and understandably - sometimes it's even more clear then pseudocode.
The text covers a broad range of topics (with varying levels of complexity). When I was reading I recalled things I learned in college classes such as: Data Structures, Algorithm Analysis, Discrete Math, Calculous, Linear Algebra, Statistics, Compiler Design, Signal Processing, and even some good old fashion high school geometry. I found this extremely helpful because the broad nature of the book doesn't allow the authors to cover a topic in great detail. They do review each topic area giving the proper terminology used along with background of how the field developed.
Within the different chapters the authors present various code segments. For some segments the authors have written there own code to implement the algorithms. In other cases, as is Perl custom, the authors have searched CPAN for the modules that implement the algorithm. Then the example code demonstrates the proper use of that module.
One of the features I really enjoyed is that each chapter can stand on its own as a nice review of the algorithms in that section. (In cases where they build on other sections you are reminded where to go and read.) Another great feature the authors include is the references - all the web sites and books you'll need are listed in Appendix A, by topic area.
The only thing I really felt was missing was a discussion on some AI topics such as Neural Networks and Genetic Programming. (If you're interesting Neural Networks in general check out The Linux Journal July 1999 p 44. For Genetic Programming in Perl check out The Perl Journal Fall 1999 p 34)
Overall, this book explains methods of implementing Algorithms with Perl blending custom techniques with resources available (CPAN) in a "learn by example" approach. It contains 16 great chapters of background, theory, sample code, diagrams, and discussion. It has a good Appendix A (for additional info on algorithms) and a useful ASCII table in Appendix B. If you want to learn good ways to implement specific Algorithms with Perl - Read this book!
Table of Contents:
Preface Chapter 1. Introduction What Is an Algorithm? Efficiency Recurrent Themes in Algorithms Chapter 2. Basic Data Structures Perl's Built-in Data Structures Build Your Own Data Structure A Simple Example Perl Arrays: Many Data Structures in One Chapter 3. Advanced Data Structures Linked Lists Circular Linked Lists Garbage Collection in Perl Doubly-Linked Lists Infinite Lists The Cost of Traversal Binary Trees Heaps Binary Heaps Janus Heap The Heaps Module Future CPAN Modules Chapter 4. Sorting An Introduction to Sorting All Sorts of Sorts Sorting Algorithms Summary Chapter 5. Searching Hash Search and Other Non-Searches Lookup Searches Generative Searches Chapter 6. Sets Venn Diagrams Creating Sets Set Union and Intersection Set Differences Counting Set Elements Set Relations The Set Modules of CPAN Sets of Sets Multivalued Sets Sets Summary Chapter 7. Matrices Creating Matrices Manipulating Individual Elements Finding the Dimensions of a Matrix Displaying Matrices Adding or Multiplying Constants Transposing a Matrix Multiplying Matrices Extracting a Submatrix Combining Matrices Inverting a Matrix Computing the Determinant Gaussian Elimination Eigenvalues and Eigenvectors The Matrix Chain Product Delving Deeper Chapter 8. Graphs Vertices and Edges Derived Graphs Graph Attributes Graph Representation in Computers Graph Traversal Paths and Bridges Graph Biology: Trees, Forests, DAGS, Ancestors, and Descendants Edge and Graph Classes CPAN Graph Modules Chapter 9. Strings Perl Builtins String-Matching Algorithms Phonetic Algorithms Stemming and Inflection Parsing Compression Chapter 10. Geometric Algorithms Distance Area, Perimeter, and Volume Direction Intersection Inclusion Boundaries Closest Pair of Points Geometric Algorithms Summary CPAN Graphics Modules Chapter 11. Number Systems Integers and Reals Strange Systems Trigonometry Significant Series Chapter 12. Number Theory Basic Number Theory Prime Numbers Unsolved Problems Chapter 13. Cryptography Legal Issues Authorizing People with Passwords Authorization of Data: Checksums and More Obscuring Data: Encryption Hiding Data: Steganography Winnowing and Chaffing Encrypted Perl Code Other Issues Chapter 14. Probability Random Numbers Events Permutations and Combinations Probability Distributions Rolling Dice: Uniform Distributions Loaded Dice and Candy Colors: Nonuniform Discrete Distributions If the Blue Jays Score Six Runs: Conditional Probability Flipping Coins Over and Over: Infinite Discrete Distributions How Much Snow? Continuous Distributions Many More Distributions Chapter 15. Statistics Statistical Measures Significance Tests Correlation Chapter 16. Numerical Analysis Computing Derivatives and Integrals Solving Equations Interpolation, Extrapolation, and Curve Fitting Appendix A. Further Reading Appendix B. ASCII Character Set Index