typedef struct_TreeNode{
char c;
TreeNode *leftchild;
TreeNode *rightchild;
}TreeNode;
int CompTree(TreeNode* tree1,TreeNode* tree2)
{
inorder(tree1);
inorder(tree2);
while(a[i]==b[i]&&i<n)
{
i++;
}
if(i==n)
return true;
else
return false;
}
inorder(TreeNode* tree,char* array[])
{
inorder(tree->leftchild,array[]);
cout<<tree->c;
array[i++]=tree->c;
inorder(tree->rightchild,array[]);
}
这样好像不行吧,array[]参数传递有问题吧?
高手给修正下.