asked on
void AVL_tree<Record>::level_order() {
queue<Binary_node<Record>*> Q;
Q.push(root); //get root in queue
while(Q.size() > 0)
{
Binary_node<Record> * sub_root = Q.front();
cout<<sub_root->data<<" "<<endl;
Q.pop(); //pop sub_root
if(sub_root->left)
Q.push(sub_root->left);
if(sub_root->right)
Q.push(sub_root->right);
}
}