b******g 发帖数: 77 | 1 struct Node
{
Value value;
Node * left;
Node * right;
}
void printBT(Node * root);
void printBT(vector & v1);
void printBT(Node * root)
{
vector v1;
v1.push_back(root);
printBT(v1);
}
// recursively printBT Date structure: using two vectors -- v1 holds nodes
of current level, v2 hold nodes of next level;
void printBT(vector & v1)
{
if ( v1.empty() )
return;
vector v2;
Node * node;
for (int i = 0; i < v1.size(); i++... 阅读全帖 |
|