//-----------------------------------------------------------------------------
#include <iostream.h>
#include "narytreeclass.cpp"
//-----------------------------------------------------------------------------
void ExternalPreorder(tree<int,4> MyTree);
//-----------------------------------------------------------------------------
int main(void) {

tree<int,4> MyTree;
treeiterator<int,4> MyIterator(MyTree);

MyTree.AddRoot(0);

MyIterator.GoRoot();
MyIterator.AddOffspring(1,1);
MyIterator.AddOffspring(2,2);
MyTree.PreorderTaverse();

MyIterator.GoDown(1);
MyIterator.AddOffspring(1,3);
MyIterator.AddOffspring(2,4);
MyTree.PreorderTaverse();

MyIterator.GoDown(2);
MyIterator.AddOffspring(1,5);
MyIterator.AddOffspring(2,6);
MyTree.PreorderTaverse();

MyIterator.GoUp();
MyIterator.GoUp();

MyIterator.GoDown(2);
MyIterator.AddOffspring(1,7);
MyIterator.AddOffspring(2,8);
MyIterator.AddOffspring(3,9);
MyTree.PreorderTaverse();

cout << "And now an external traverse" << endl;
ExternalPreorder(MyTree);

return(0);
}
//-----------------------------------------------------------------------------
void ExternalPreorder(tree<int,4> MyTree) {

cout << "MTH517 students can easily implement this!" << endl;
}
//-----------------------------------------------------------------------------
