538.把二叉搜索树转换位累加树

https://leetcode-cn.com/problems/convert-bst-to-greater-tree/

一:反向中序遍历

根据二叉搜索树性质,反向中序遍历,累加路径上的每个节点,就得到8,15,21,26,30……

最后更新于