void oldrecursiveprint(StringTree * t) { // this is position 1; if (t!=NULL) { oldrecursiveprint(t->left); // this is position 2; cout << t->data << "\n"; oldrecursiveprint(t->right); } } ... struct LittleNote { StringTree * tree; int position; LittleNote(void) { } LittleNote(StringTree * t, int pos): tree(t), position(pos) { } }; LittleNote stack[100]; int numinstack = 0; void push(LittleNote n) { stack[numinstack] = n; numinstack += 1; } LittleNote pop(void) { numinstack -= 1; return stack[numinstack]; } void print(StringTree *t) { numinstack = 0; push(LittleNote(t, 1)); while (numinstack>0) { LittleNote note = pop(); t = note.tree; switch (note.position) { case 1: { if (t!=NULL) { push(LittleNote(t, 2)); push(LittleNote(t->left, 1)); } break; } case 2: { cout << t->data << "\n"; push(LittleNote(t->right, 1)); break; } } } cout << "\n"; } ...