Tree

145. Binary Tree Postorder Traversal

145. Binary Tree Postorder Traversal # Definition for a binary tree

111. Minimum Depth of Binary Tree

111. Minimum Depth of Binary Tree DFS # Definition for a

255. Verify Preorder Sequence in Binary Search Tree

255. Verify Preorder Sequence in Binary Search Tree 遞迴(超時)

114. Flatten Binary Tree to Linked List

114. Flatten Binary Tree to Linked List 這一是後續遍歷很經典的一道題目,體現了後續遍歷很重要的一個精神,當後續遍歷到一半,

429. N-ary Tree Level Order Traversal

429. N-ary Tree Level Order Traversal 可以先做這題 116. Populating Next

543. Diameter of Binary Tree

543. Diameter of Binary Tree 這一題和 124. Binary Tree Maximum

417. Pacific Atlantic Water Flow

417. Pacific Atlantic Water Flow 廣度優先搜索 BFS 也可以利用一次把多個點加入 queue 後再開始出發,

113. Path Sum II

113. Path Sum II 這一題比較困難的是,雖然是樹的遍歷加上回溯法。 # Definition for a binary

104. Maximum Depth of Binary Tree

104. Maximum Depth of Binary Tree # Definition for a binary

752. Open the Lock

752. Open the Lock class Solution: def openLock(self, deadends: