Posted in d, algorithms on November 5th, 2008 No Comments »
Found a nice collection of hash routines written in D. These are easy to convert to other languages. I was just looking for Robert Sedgewick’s hash function since I didn’t have his book handy.
Posted in algorithms, db on October 20th, 2008 No Comments »
Just a small post, maybe more to come detailing actual implementation details:
Tree Structured Indexes
Design of BTRFS
Posted in ruby, algorithms on January 8th, 2008 5 Comments »
Many wonderful things can be done with binary trees. One brilliant usage of the binary tree was proposed by David Huffman in 1951 at MIT which has since become the foundation for much of the compression technology available today. Huffman discovered a simple way to generate a provable minimal binary encoding given a set of […]
Posted in ruby, algorithms on January 7th, 2008 1 Comment »
Building algorithms in ruby is fun and rewarding. This binary tree doesn’t balance itself but it is simple and flexible using ruby blocks for visit and insert. Traversal style can be selected optionally to visit with :inorder, :preorder or :postorder.
Here’s your basic binary tree node representation, it holds a value and connects to a left […]