Test Code for using trees with c++ pointers