Implementation of a binary tree in C++