Simple example of using stack, lists and trees structures in C++