Thales interview question

C++ virtual function, traverse tree without recursion