Print a binary tree level by level
Anonymous
void print_in_order(Node* node) { std::stack nodes; nodes.push(node); while(!nodes.empty()) { Node* temp = nodes.top(); if (temp) { cout value left); nodes.push(node->right); } nodes.pop(); } }
Check out your Company Bowl for anonymous work chats.