Tree

701. Insert into a Binary Search Tree

701. Insert into a Binary Search Tree 如果是要在一個 BST 中插入一個點,

112. Path Sum

112. Path Sum 這個題目很像是 N Sum 的題目,不過是從根節點開始,找到是不是可以從根節點到葉節點之間,所有的值加起來剛好和目標相同。

426. Convert Binary Search Tree to Sorted Doubly Linked List

426. Convert Binary Search Tree to Sorted Doubly Linked List

116. Populating Next Right Pointers in Each Node

116. Populating Next Right Pointers in Each Node 這一題要考的點是對進行 BFS

450. Delete Node in a BST

450. Delete Node in a BST 這個題目給定的條件可以很簡單:給定一個數值,要我們在二元搜尋樹中找到哪個節點的數值等於此值,並且刪掉他。

700. Search in a Binary Search Tree

700. Search in a Binary Search Tree 如果說題目只是問「樹」中是否存在一個節點有某個值,

1379. Find a Corresponding Node of a Binary Tree in a Clone of That Tree

1379. Find a Corresponding Node of a Binary Tree in

117. Populating Next Right Pointers in Each Node II

117. Populating Next Right Pointers in Each Node II "

102. Binary Tree Level Order Traversal

102. Binary Tree Level Order Traversal BFS # Definition for a

323. Number of Connected Components in an Undirected Graph

可以繼承 547. Number of Provinces 的做法,先轉換給定的 edges 成一個矩陣。 class