binary tree (dog implementation)