list <Node>stack;stack.pushFront(root);while(!stack.IsEmpty()){ Node current = stack.popFront(); parseNode(current); foreach(Node child, current.children) { stack.pushFront(child); }}