struct BTNode_s{
int value;
BTNode_s* pLeft;
BTNode_s* pRight;
}BTNode;
void BFS(BTNode* pRoot)
{
if(pRoot ==NULL)
return;
std::deque<BTNode*> treeDeque;
treeDeque.push_back(pRoot);
while(!treeDeque.empty())
{
BTNode* pNode =treeDeque.front();
printf("%d\t", pNode->value);
if(pNode->pLeft!= NULL)
{
treeDeque.push_back(pNode->pLeft);
}
if(pNode->pRight!= NULL)
{
treeDeque.push_back(pNode->pRight);
}
}
}