Files
2021-01-17 02:23:56 +08:00

8.0 KiB

title type
Tree docs

Tree

No. Title Solution Difficulty TimeComplexity SpaceComplexity Favorite Acceptance
0094 Binary Tree Inorder Traversal [Go]({{< relref "/ChapterFour/0094.Binary-Tree-Inorder-Traversal.md" >}}) Medium O(n) O(1) 65.4%
0095 Unique Binary Search Trees II [Go]({{< relref "/ChapterFour/0095.Unique-Binary-Search-Trees-II.md" >}}) Medium 42.1%
0096 Unique Binary Search Trees [Go]({{< relref "/ChapterFour/0096.Unique-Binary-Search-Trees.md" >}}) Medium O(n^2) O(n) 54.1%
0098 Validate Binary Search Tree [Go]({{< relref "/ChapterFour/0098.Validate-Binary-Search-Tree.md" >}}) Medium O(n) O(1) 28.6%
0099 Recover Binary Search Tree [Go]({{< relref "/ChapterFour/0099.Recover-Binary-Search-Tree.md" >}}) Hard O(n) O(1) 42.1%
0100 Same Tree [Go]({{< relref "/ChapterFour/0100.Same-Tree.md" >}}) Easy O(n) O(1) 54.0%
0101 Symmetric Tree [Go]({{< relref "/ChapterFour/0101.Symmetric-Tree.md" >}}) Easy O(n) O(1) 47.9%
0102 Binary Tree Level Order Traversal [Go]({{< relref "/ChapterFour/0102.Binary-Tree-Level-Order-Traversal.md" >}}) Medium O(n) O(1) 56.2%
0103 Binary Tree Zigzag Level Order Traversal [Go]({{< relref "/ChapterFour/0103.Binary-Tree-Zigzag-Level-Order-Traversal.md" >}}) Medium O(n) O(n) 49.8%
0104 Maximum Depth of Binary Tree [Go]({{< relref "/ChapterFour/0104.Maximum-Depth-of-Binary-Tree.md" >}}) Easy O(n) O(1) 67.7%
0105 Construct Binary Tree from Preorder and Inorder Traversal [Go]({{< relref "/ChapterFour/0105.Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.md" >}}) Medium 51.2%
0106 Construct Binary Tree from Inorder and Postorder Traversal [Go]({{< relref "/ChapterFour/0106.Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal.md" >}}) Medium 49.1%
0107 Binary Tree Level Order Traversal II [Go]({{< relref "/ChapterFour/0107.Binary-Tree-Level-Order-Traversal-II.md" >}}) Easy O(n) O(1) 54.8%
0108 Convert Sorted Array to Binary Search Tree [Go]({{< relref "/ChapterFour/0108.Convert-Sorted-Array-to-Binary-Search-Tree.md" >}}) Easy O(n) O(1) 59.9%
0110 Balanced Binary Tree [Go]({{< relref "/ChapterFour/0110.Balanced-Binary-Tree.md" >}}) Easy O(n) O(1) 44.6%
0111 Minimum Depth of Binary Tree [Go]({{< relref "/ChapterFour/0111.Minimum-Depth-of-Binary-Tree.md" >}}) Easy O(n) O(1) 39.2%
0112 Path Sum [Go]({{< relref "/ChapterFour/0112.Path-Sum.md" >}}) Easy O(n) O(1) 42.1%
0113 Path Sum II [Go]({{< relref "/ChapterFour/0113.Path-Sum-II.md" >}}) Medium O(n) O(1) 48.6%
0114 Flatten Binary Tree to Linked List [Go]({{< relref "/ChapterFour/0114.Flatten-Binary-Tree-to-Linked-List.md" >}}) Medium O(n) O(1) 51.4%
0124 Binary Tree Maximum Path Sum [Go]({{< relref "/ChapterFour/0124.Binary-Tree-Maximum-Path-Sum.md" >}}) Hard O(n) O(1) 35.2%
0129 Sum Root to Leaf Numbers [Go]({{< relref "/ChapterFour/0129.Sum-Root-to-Leaf-Numbers.md" >}}) Medium O(n) O(1) 50.6%
0144 Binary Tree Preorder Traversal [Go]({{< relref "/ChapterFour/0144.Binary-Tree-Preorder-Traversal.md" >}}) Medium O(n) O(1) 57.1%
0145 Binary Tree Postorder Traversal [Go]({{< relref "/ChapterFour/0145.Binary-Tree-Postorder-Traversal.md" >}}) Medium O(n) O(1) 57.1%
0173 Binary Search Tree Iterator [Go]({{< relref "/ChapterFour/0173.Binary-Search-Tree-Iterator.md" >}}) Medium O(n) O(1) 59.6%
0199 Binary Tree Right Side View [Go]({{< relref "/ChapterFour/0199.Binary-Tree-Right-Side-View.md" >}}) Medium O(n) O(1) 55.7%
0222 Count Complete Tree Nodes [Go]({{< relref "/ChapterFour/0222.Count-Complete-Tree-Nodes.md" >}}) Medium O(n) O(1) 48.8%
0226 Invert Binary Tree [Go]({{< relref "/ChapterFour/0226.Invert-Binary-Tree.md" >}}) Easy O(n) O(1) 66.6%
0230 Kth Smallest Element in a BST [Go]({{< relref "/ChapterFour/0230.Kth-Smallest-Element-in-a-BST.md" >}}) Medium O(n) O(1) 62.1%
0235 Lowest Common Ancestor of a Binary Search Tree [Go]({{< relref "/ChapterFour/0235.Lowest-Common-Ancestor-of-a-Binary-Search-Tree.md" >}}) Easy O(n) O(1) 51.4%
0236 Lowest Common Ancestor of a Binary Tree [Go]({{< relref "/ChapterFour/0236.Lowest-Common-Ancestor-of-a-Binary-Tree.md" >}}) Medium O(n) O(1) 48.1%
0257 Binary Tree Paths [Go]({{< relref "/ChapterFour/0257.Binary-Tree-Paths.md" >}}) Easy O(n) O(1) 53.2%
0337 House Robber III [Go]({{< relref "/ChapterFour/0337.House-Robber-III.md" >}}) Medium 51.7%
0404 Sum of Left Leaves [Go]({{< relref "/ChapterFour/0404.Sum-of-Left-Leaves.md" >}}) Easy O(n) O(1) 52.2%
0437 Path Sum III [Go]({{< relref "/ChapterFour/0437.Path-Sum-III.md" >}}) Medium O(n) O(1) 48.0%
0508 Most Frequent Subtree Sum [Go]({{< relref "/ChapterFour/0508.Most-Frequent-Subtree-Sum.md" >}}) Medium 58.9%
0513 Find Bottom Left Tree Value [Go]({{< relref "/ChapterFour/0513.Find-Bottom-Left-Tree-Value.md" >}}) Medium 62.3%
0515 Find Largest Value in Each Tree Row [Go]({{< relref "/ChapterFour/0515.Find-Largest-Value-in-Each-Tree-Row.md" >}}) Medium O(n) O(n) 62.0%
0563 Binary Tree Tilt [Go]({{< relref "/ChapterFour/0563.Binary-Tree-Tilt.md" >}}) Easy 52.6%
0572 Subtree of Another Tree [Go]({{< relref "/ChapterFour/0572.Subtree-of-Another-Tree.md" >}}) Easy 44.4%
0637 Average of Levels in Binary Tree [Go]({{< relref "/ChapterFour/0637.Average-of-Levels-in-Binary-Tree.md" >}}) Easy O(n) O(n) 64.5%
0653 Two Sum IV - Input is a BST [Go]({{< relref "/ChapterFour/0653.Two-Sum-IV---Input-is-a-BST.md" >}}) Easy 56.1%
0662 Maximum Width of Binary Tree [Go]({{< relref "/ChapterFour/0662.Maximum-Width-of-Binary-Tree.md" >}}) Medium 40.0%
0684 Redundant Connection [Go]({{< relref "/ChapterFour/0684.Redundant-Connection.md" >}}) Medium 58.7%
0685 Redundant Connection II [Go]({{< relref "/ChapterFour/0685.Redundant-Connection-II.md" >}}) Hard 32.9%
0834 Sum of Distances in Tree [Go]({{< relref "/ChapterFour/0834.Sum-of-Distances-in-Tree.md" >}}) Hard 45.5%
0863 All Nodes Distance K in Binary Tree [Go]({{< relref "/ChapterFour/0863.All-Nodes-Distance-K-in-Binary-Tree.md" >}}) Medium 57.5%
0872 Leaf-Similar Trees [Go]({{< relref "/ChapterFour/0872.Leaf-Similar-Trees.md" >}}) Easy 64.5%
0897 Increasing Order Search Tree [Go]({{< relref "/ChapterFour/0897.Increasing-Order-Search-Tree.md" >}}) Easy 74.3%
0968 Binary Tree Cameras [Go]({{< relref "/ChapterFour/0968.Binary-Tree-Cameras.md" >}}) Hard 38.5%
0979 Distribute Coins in Binary Tree [Go]({{< relref "/ChapterFour/0979.Distribute-Coins-in-Binary-Tree.md" >}}) Medium 69.5%
0993 Cousins in Binary Tree [Go]({{< relref "/ChapterFour/0993.Cousins-in-Binary-Tree.md" >}}) Easy O(n) O(1) 52.2%
1026 Maximum Difference Between Node and Ancestor [Go]({{< relref "/ChapterFour/1026.Maximum-Difference-Between-Node-and-Ancestor.md" >}}) Medium 69.1%
1028 Recover a Tree From Preorder Traversal [Go]({{< relref "/ChapterFour/1028.Recover-a-Tree-From-Preorder-Traversal.md" >}}) Hard 70.7%
1110 Delete Nodes And Return Forest [Go]({{< relref "/ChapterFour/1110.Delete-Nodes-And-Return-Forest.md" >}}) Medium 67.5%
1123 Lowest Common Ancestor of Deepest Leaves [Go]({{< relref "/ChapterFour/1123.Lowest-Common-Ancestor-of-Deepest-Leaves.md" >}}) Medium 67.8%
1145 Binary Tree Coloring Game [Go]({{< relref "/ChapterFour/1145.Binary-Tree-Coloring-Game.md" >}}) Medium 51.4%
1302 Deepest Leaves Sum [Go]({{< relref "/ChapterFour/1302.Deepest-Leaves-Sum.md" >}}) Medium 84.1%
1305 All Elements in Two Binary Search Trees [Go]({{< relref "/ChapterFour/1305.All-Elements-in-Two-Binary-Search-Trees.md" >}}) Medium 77.8%
------------ ------------------------------------------------------- ------- ---------------- --------------- ------------- ------------- -------------