Skip to content

Latest commit

 

History

History
 
 

897.Increasing-Order-Search-Tree

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

897.Increasing-Order-Search-Tree

典型的递归函数处理树的问题。抽象起来,increasingBST要做四件事情:1. 将左子树拉成一条直线;2.将根节点加在左子树(直线)的最后一个节点的右边;3.将右子树拉成一条直线;4. 将右子树拼接在原根节点的右边。最后返回的是新树的根。其中第一步和第三步就是increasingBST本身。