The Fake Geek's blog: B-Tree Java implementation
B-Tree Java implementation Two days of coding. One afternoon to build a tree, three nights to destroy the tree in different ways, I finally make the code. Sort of... The code works for M >= 4, where M is the number of maximum key-value pairs in one node (In fact, this number can never be reached because the node will be split into two once this number is reached. For rules on how B-Tree works, refer to this post . I may update this blog when I fix the deletion issue with M = 3 (probably rewrite the code to make it cleaner). Moreover, it turns out Cassandra has a B-Tree implementation. It's a little bit to complicated for me (plus I couldn't find its deletion implementation), but it's interesting to take a look. Check here . package bTree; /** * M: maximum degree/number of key-value pairs in a node * HT:height of the B-tree * N: number of key-value pairs in the tree * @author shirleyyoung * * @param * @param */ public class BTreeRead full article from The Fake Geek's blog: B-Tree Java implementation
No comments:
Post a Comment