I'm currently enrolled in a Data Structures & Algorithms class.
A fair portion of the class involves coding some common algorithms.
Unfortunately, the languages used for the class are Java and C++, but I figured it would be good practice to try implementing a few of these algorithms in Perl.
Most of the algorithms described in our text (the White Book, by Cormen, Leiserson, and Rivest)
are rather slick, and I can see that many of them would make useful Perl modules.
As long as I've committed myself to implementing some of these algorithms in Perl, I figured I might as well make my results into modules, with the eventual intent that they might (if properly done) end up in CPAN.
Unfortunately (for me), quite a few of the interesting algorithms, such as Boyer-Moore string searching and hashtables, are already Perl built-ins, and most of the others (such as a variety of heaps, red/black trees, and efficient sorting algorithms) are already in CPAN.
Thus, I have a few questions to ask of my fellow monks:
- What are some interesting algorithms that you've personally implemented and found enlightening? The main point of my little project here is to enhance my learning, so if there are any algorithms or data structures that have somehow fundamentally changed how you think about programming, I'd be very interesting in knowing about them.
- Are there any data structures/algorithms modules not on CPAN that should be implemented?
- Are there any modules on CPAN that you've used and found somehow deficient? If there are any modules that simply need maintenance, a code review, or better documentation, I'd be willing to talk to the authors and ask if they'll take my help.
To let you know what I'm presently thinking, here are a few options I'm pondering:
- The Graph package, by Jarkko Hietaniemi, appears to be derived straight from Mastering Algorithms with Perl, and is relatively complete. The only irk I have with it is the documentation, which (in my opinion) could be better. I may end up playing with these modules a bit and seeing if I couldn't write some better documentation for them.
- Another possibility with the Graph modules would be to create a GUI front-end that allows the user to create instances of graphs in a graphical environment and perform various operations on them. I don't see this sort of thing as a very practical application, but perhaps it could be used to teach basic graph theory or to solve simple graph problems.
- Implementing a basic decision-tree structure. There doesn't seem to be one on CPAN, and I could create a decision tree based on the Tree::Nary module. This would be interesting to me because I'm interested in AI (mostly for the purposes of game-playing, though ;)).
Thank you, in advance, for any comments or suggestions you may have. :)