title | type |
---|---|
Depth First Search |
docs |
Title | Solution | Difficulty | Time | Space | 收藏 |
---|---|---|---|---|---|
98. Validate Binary Search Tree | [Go]({{< relref "/ChapterFour/0098.Validate-Binary-Search-Tree.md" >}}) | Medium | O(n) | O(1) | |
99. Recover Binary Search Tree | [Go]({{< relref "/ChapterFour/0099.Recover-Binary-Search-Tree.md" >}}) | Hard | O(n) | O(1) | |
100. Same Tree | [Go]({{< relref "/ChapterFour/0100.Same-Tree.md" >}}) | Easy | O(n) | O(1) | |
101. Symmetric Tree | [Go]({{< relref "/ChapterFour/0101.Symmetric-Tree.md" >}}) | Easy | O(n) | O(1) | |
104. Maximum Depth of Binary Tree | [Go]({{< relref "/ChapterFour/0104.Maximum-Depth-of-Binary-Tree.md" >}}) | Easy | O(n) | O(1) | |
108. Convert Sorted Array to Binary Search Tree | [Go]({{< relref "/ChapterFour/0108.Convert-Sorted-Array-to-Binary-Search-Tree.md" >}}) | Easy | O(n) | O(1) | |
109. Convert Sorted List to Binary Search Tree | [Go]({{< relref "/ChapterFour/0109.Convert-Sorted-List-to-Binary-Search-Tree.md" >}}) | Medium | O(log n) | O(n) | |
110. Balanced Binary Tree | [Go]({{< relref "/ChapterFour/0110.Balanced-Binary-Tree.md" >}}) | Easy | O(n) | O(1) | |
111. Minimum Depth of Binary Tree | [Go]({{< relref "/ChapterFour/0111.Minimum-Depth-of-Binary-Tree.md" >}}) | Easy | O(n) | O(1) | |
112. Path Sum | [Go]({{< relref "/ChapterFour/0112.Path-Sum.md" >}}) | Easy | O(n) | O(1) | |
113. Path Sum II | [Go]({{< relref "/ChapterFour/0113.Path-Sum-II.md" >}}) | Medium | O(n) | O(1) | |
114. Flatten Binary Tree to Linked List | [Go]({{< relref "/ChapterFour/0114.Flatten-Binary-Tree-to-Linked-List.md" >}}) | Medium | O(n) | O(1) | |
124. Binary Tree Maximum Path Sum | [Go]({{< relref "/ChapterFour/0124.Binary-Tree-Maximum-Path-Sum.md" >}}) | Hard | O(n) | O(1) | |
129. Sum Root to Leaf Numbers | [Go]({{< relref "/ChapterFour/0129.Sum-Root-to-Leaf-Numbers.md" >}}) | Medium | O(n) | O(1) | |
199. Binary Tree Right Side View | [Go]({{< relref "/ChapterFour/0199.Binary-Tree-Right-Side-View.md" >}}) | Medium | O(n) | O(1) | |
200. Number of Islands | [Go]({{< relref "/ChapterFour/0200.Number-of-Islands.md" >}}) | Medium | O(n^2) | O(n^2) | |
207. Course Schedule | [Go]({{< relref "/ChapterFour/0207.Course-Schedule.md" >}}) | Medium | O(n^2) | O(n^2) | |
210. Course Schedule II | [Go]({{< relref "/ChapterFour/0210.Course-Schedule-II.md" >}}) | Medium | O(n^2) | O(n^2) | |
257. Binary Tree Paths | [Go]({{< relref "/ChapterFour/0257.Binary-Tree-Paths.md" >}}) | Easy | O(n) | O(1) | |
394. Decode String | [Go]({{< relref "/ChapterFour/0394.Decode-String.md" >}}) | Medium | O(n) | O(n) | |
515. Find Largest Value in Each Tree Row | [Go]({{< relref "/ChapterFour/0515.Find-Largest-Value-in-Each-Tree-Row.md" >}}) | Medium | O(n) | O(n) | |
542. 01 Matrix | [Go]({{< relref "/ChapterFour/0542.01-Matrix.md" >}}) | Medium | O(n) | O(1) | |
980. Unique Paths III | [Go]({{< relref "/ChapterFour/0980.Unique-Paths-III.md" >}}) | Hard | O(n log n) | O(n) | |
--------------------------------------- | --------------------------------- | -------------------------- | ----------------------- | ----------- | -------- |