这个数据结构有讲到,如果一点都不懂可以看看数据结构的树那一章代码如下,思路见代码 #includeusing namespace std;struct mTreeNode{mTreeNode():val(0){}int