一步一步的推演递归是如何遍历完整个二叉树的 https://www.bilibili.com/video/BV1fZ4y1p7M9 #include<stdio.h>#include<stdlib.h>#defineMAXSIZE 20typedefstructnode{intdata;structnode*right;structnode*left; }Node; typedefstruct{ Node*root; }Tree; //二叉树的创建voidinsert(Tree *tree,intvalue) {...
cout<<"树的高度为:"<<Height<<endl; int Leaves = 0; TreeLeaves(root,Leaves); cout<<"树的叶子节点数为:"<<Leaves<<endl; cout<<"层序遍历二叉树:"; LevelOrderPrintTree(root); int Width = 0; TreeWidth(root,Width); cout<<"树的宽度为:"<<Width<<endl; cout<<"非递归访问二叉树为:";...