Created
July 24, 2013 10:02
-
-
Save smvv/6069349 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub static BTREE_MIN_DEGREE : uint = 20; | |
//pub static BTREE_MIN_DEGREE : uint = 2; | |
pub static BTREE_KEYS_LBOUND : uint = BTREE_MIN_DEGREE - 1; | |
pub static BTREE_KEYS_UBOUND : uint = 2 * BTREE_MIN_DEGREE - 1; | |
pub struct BTree<K, V> { | |
priv used: uint, | |
priv keys: [Option<K>, ..BTREE_KEYS_UBOUND], | |
priv nodes: [Option<TreeItem<K, V>>, ..BTREE_KEYS_UBOUND + 1], | |
} | |
pub enum TreeItem<K, V> { | |
TreeNode { value: ~BTree<K, V> }, | |
TreeLeaf { value: V }, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment