template <typename T> void NonRecursiveMidTraverse(CTreeNode<T>* pTreeNode) { while (true) { while (pTreeNode) { g_stack.Push(pTreeNode); pTreeNode = pTreeNode->pLChild; } if (g_stack.IsEmpty()) { break; } pTreeNode = g_stack.Pop(); printf("Node:%d ", pTreeNode->nData); pTreeNode = pTreeNode->pRChild; } }