LeetCode

222. Count Complete Tree Nodes

222. Count Complete Tree Nodes 線性搜索 # Definition for a binary

559. Maximum Depth of N-ary Tree

559. Maximum Depth of N-ary Tree """ # Definition

261. Graph Valid Tree

261. Graph Valid Tree 題目給定一個數字 n 和一個陣列,n 代表的是一個圖中,所用有的節點數量,

106. Construct Binary Tree from Inorder and Postorder Traversal

106. Construct Binary Tree from Inorder and Postorder Traversal postorder

124. Binary Tree Maximum Path Sum

124. Binary Tree Maximum Path Sum 這一題是後序遍歷的經典題目,後序遍歷的精神就是先將子樹的問題全部解決,再開始處理跟節點的問題,這一題要怎麼想到的確是屬於困難的題型。

437. Path Sum III

437. Path Sum III 更難的樹的遍歷加上回溯法。 # Definition for a binary tree

286. Walls and Gates

286. Walls and Gates 題目給定一個矩陣,矩陣內有標記了牆與門,剩餘的點被標註成一個無限大的數值,意義為可以行走的點,要求把這些矩陣中除了門與牆以外的點,以該點到達附近最近的門的距離為何?

590. N-ary Tree Postorder Traversal

590. N-ary Tree Postorder Traversal """ # Definition for

144. Binary Tree Preorder Traversal

144. Binary Tree Preorder Traversal # Definition for a binary tree

297. Serialize and Deserialize Binary Tree

297. Serialize and Deserialize Binary Tree 這一題可以透過 536. Construct Binary