层次遍历

void  traverse(pBitree root)
{
    queue<pBitree>T;
    T.push(root);
    while (!T.empty())
    {
        printf("%c", T.front()->data);
        if (T.front()->lchild!=NULL)
        T.push(T.front()->lchild);
        if (T.front()->lchild!=NULL)
        T.push(T.front()->rchild);
        T.pop();
    }
}

原文地址:https://www.cnblogs.com/da-peng/p/4964080.html