已知一个搜索二叉树后序遍历的数组pasArr,请根据posArr,重建出整颗树,返回新建树的头结点
知识点补充:
1.搜索二叉树:所有左子树小于右子树
2.后序遍历:左->右->头
技能:
1.注意体会m=l-1。这样可以巧妙的解决只有左子树或只有右子树的情况
答案:com.edu.sunyifeng.pasArrToBST
algorithm
Directory actions
More options
Directory actions
More options
algorithm
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||