C++ to illustrate the tree as well