Tree alt nodes reverse and Nested classes in C++