leetcodePython3/class/Tree_Action.py
def flatten(self, root: TreeNode) -> None:
        """
        Do not return anything, modify root in-place instead.
        """
        #先讲右链表组装到做链表 然后左链表在组装到root的右链表
        if not root:
            return None
        self.flatten(root.right)
        self.flatten(root.left)

        root.right = self.prev
        root.left = None
        self.prev = root

        Do not return anything, modify root in-place instead.
        
Do not return anything, modify root in-place instead.
Do not return anything modify root in - place instead .
def flatten(self, root: TreeNode) -> None:
        if not root:
            return None
        self.flatten(root.right)
        self.flatten(root.left)
        root.right = self.prev
        root.left = None
        self.prev = root
def flatten ( self , root : TreeNode ) -> None : if not root : return None self . flatten ( root . right ) self . flatten ( root . left ) root . right = self . prev root . left = None self . prev = root
Do not return anything, modify root in-place instead.
Do not return anything modify root in - place instead .
"""
        Do not return anything, modify root in-place instead.
        """ #先讲右链表组装到做链表 然后左链表在组装到root的右链表
self
root
TreeNode