You are viewing a single comment's thread. Return to all comments →
My C++ Implementation
queue<Node*> Q; Q.push(root); while (!Q.empty()) { Node *current = Q.front(); cout<<current->data<<" "; if(current->left != nullptr) { Q.push(current->left); } if(current->right != nullptr) { Q.push(current->right); } Q.pop(); }
Seems like cookies are disabled on this browser, please enable them to open this website
Tree: Level Order Traversal
You are viewing a single comment's thread. Return to all comments →
My C++ Implementation