114. Flatten Binary Tree to Linked List
·
Algorithm
Flatten Binary Tree to Linked List - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 1. Post - Order class Solution: def flatten(self, root: TreeNode) -> None: stack, temp = [], [] cur = root while True: while cur: temp.append(cur) stack.append(cur) cur = cur.left if not stack: bre..