Tree and binary tree implementation