Simple implementation of binary trees