/*
node class contains:
node* left;
node* right;
int value;
*/
void levelOrder(node* root){
node* ptr=nullptr;
queue<node*> q;
q.push(root);
while(!q.empty()){
ptr=q.front();
cout<<ptr->value<<endl;
if(ptr->left!=nullptr){
q.push(ptr->left);
}
if(ptr->right!=nullptr){
q.push(ptr->right);
}
q.pop();
}
}