BTree and AVL tree implementation