You are viewing a single comment's thread. Return to all comments →
while(!q.empty()) { temp= q.front(); q.pop(); cout<<temp->data<<" "; if(temp->left != NULL) { q.push(temp->left); } if(temp->right != NULL) { q.push(temp->right); } }
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 →