mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-24 02:14:00 +08:00
11 KiB
11 KiB
title | type | weight |
---|---|---|
2.09 Depth First Search | docs | 9 |
Depth First Search
No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity | Favorite | Acceptance |
---|---|---|---|---|---|---|---|
0017 | Letter Combinations of a Phone Number | [Go]({{< relref "/ChapterFour/0001~0099/0017.Letter-Combinations-of-a-Phone-Number.md" >}}) | Medium | 50.4% | |||
0098 | Validate Binary Search Tree | [Go]({{< relref "/ChapterFour/0001~0099/0098.Validate-Binary-Search-Tree.md" >}}) | Medium | O(n) | O(1) | 29.1% | |
0099 | Recover Binary Search Tree | [Go]({{< relref "/ChapterFour/0001~0099/0099.Recover-Binary-Search-Tree.md" >}}) | Medium | O(n) | O(1) | 43.2% | |
0100 | Same Tree | [Go]({{< relref "/ChapterFour/0100~0199/0100.Same-Tree.md" >}}) | Easy | O(n) | O(1) | 54.4% | |
0101 | Symmetric Tree | [Go]({{< relref "/ChapterFour/0100~0199/0101.Symmetric-Tree.md" >}}) | Easy | O(n) | O(1) | 48.9% | |
0104 | Maximum Depth of Binary Tree | [Go]({{< relref "/ChapterFour/0100~0199/0104.Maximum-Depth-of-Binary-Tree.md" >}}) | Easy | O(n) | O(1) | 68.8% | |
0105 | Construct Binary Tree from Preorder and Inorder Traversal | [Go]({{< relref "/ChapterFour/0100~0199/0105.Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.md" >}}) | Medium | 53.1% | |||
0106 | Construct Binary Tree from Inorder and Postorder Traversal | [Go]({{< relref "/ChapterFour/0100~0199/0106.Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal.md" >}}) | Medium | 50.8% | |||
0108 | Convert Sorted Array to Binary Search Tree | [Go]({{< relref "/ChapterFour/0100~0199/0108.Convert-Sorted-Array-to-Binary-Search-Tree.md" >}}) | Easy | O(n) | O(1) | 61.6% | |
0109 | Convert Sorted List to Binary Search Tree | [Go]({{< relref "/ChapterFour/0100~0199/0109.Convert-Sorted-List-to-Binary-Search-Tree.md" >}}) | Medium | O(log n) | O(n) | 52.2% | |
0110 | Balanced Binary Tree | [Go]({{< relref "/ChapterFour/0100~0199/0110.Balanced-Binary-Tree.md" >}}) | Easy | O(n) | O(1) | 45.1% | |
0111 | Minimum Depth of Binary Tree | [Go]({{< relref "/ChapterFour/0100~0199/0111.Minimum-Depth-of-Binary-Tree.md" >}}) | Easy | O(n) | O(1) | 40.2% | |
0112 | Path Sum | [Go]({{< relref "/ChapterFour/0100~0199/0112.Path-Sum.md" >}}) | Easy | O(n) | O(1) | 43.0% | |
0113 | Path Sum II | [Go]({{< relref "/ChapterFour/0100~0199/0113.Path-Sum-II.md" >}}) | Medium | O(n) | O(1) | 50.1% | |
0114 | Flatten Binary Tree to Linked List | [Go]({{< relref "/ChapterFour/0100~0199/0114.Flatten-Binary-Tree-to-Linked-List.md" >}}) | Medium | O(n) | O(1) | 53.7% | |
0124 | Binary Tree Maximum Path Sum | [Go]({{< relref "/ChapterFour/0100~0199/0124.Binary-Tree-Maximum-Path-Sum.md" >}}) | Hard | O(n) | O(1) | 35.9% | |
0129 | Sum Root to Leaf Numbers | [Go]({{< relref "/ChapterFour/0100~0199/0129.Sum-Root-to-Leaf-Numbers.md" >}}) | Medium | O(n) | O(1) | 51.9% | |
0130 | Surrounded Regions | [Go]({{< relref "/ChapterFour/0100~0199/0130.Surrounded-Regions.md" >}}) | Medium | 30.2% | |||
0131 | Palindrome Partitioning | [Go]({{< relref "/ChapterFour/0100~0199/0131.Palindrome-Partitioning.md" >}}) | Medium | 53.4% | |||
0199 | Binary Tree Right Side View | [Go]({{< relref "/ChapterFour/0100~0199/0199.Binary-Tree-Right-Side-View.md" >}}) | Medium | O(n) | O(1) | 56.9% | |
0200 | Number of Islands | [Go]({{< relref "/ChapterFour/0200~0299/0200.Number-of-Islands.md" >}}) | Medium | O(n^2) | O(n^2) | 50.2% | |
0207 | Course Schedule | [Go]({{< relref "/ChapterFour/0200~0299/0207.Course-Schedule.md" >}}) | Medium | O(n^2) | O(n^2) | 44.4% | |
0210 | Course Schedule II | [Go]({{< relref "/ChapterFour/0200~0299/0210.Course-Schedule-II.md" >}}) | Medium | O(n^2) | O(n^2) | 43.5% | |
0211 | Design Add and Search Words Data Structure | [Go]({{< relref "/ChapterFour/0200~0299/0211.Design-Add-and-Search-Words-Data-Structure.md" >}}) | Medium | 41.1% | |||
0257 | Binary Tree Paths | [Go]({{< relref "/ChapterFour/0200~0299/0257.Binary-Tree-Paths.md" >}}) | Easy | O(n) | O(1) | 54.7% | |
0329 | Longest Increasing Path in a Matrix | [Go]({{< relref "/ChapterFour/0300~0399/0329.Longest-Increasing-Path-in-a-Matrix.md" >}}) | Hard | 46.8% | |||
0337 | House Robber III | [Go]({{< relref "/ChapterFour/0300~0399/0337.House-Robber-III.md" >}}) | Medium | 52.1% | |||
0394 | Decode String | [Go]({{< relref "/ChapterFour/0300~0399/0394.Decode-String.md" >}}) | Medium | O(n) | O(n) | 53.4% | |
0417 | Pacific Atlantic Water Flow | [Go]({{< relref "/ChapterFour/0400~0499/0417.Pacific-Atlantic-Water-Flow.md" >}}) | Medium | 44.7% | |||
0491 | Increasing Subsequences | [Go]({{< relref "/ChapterFour/0400~0499/0491.Increasing-Subsequences.md" >}}) | Medium | 48.2% | |||
0494 | Target Sum | [Go]({{< relref "/ChapterFour/0400~0499/0494.Target-Sum.md" >}}) | Medium | 45.6% | |||
0513 | Find Bottom Left Tree Value | [Go]({{< relref "/ChapterFour/0500~0599/0513.Find-Bottom-Left-Tree-Value.md" >}}) | Medium | 63.1% | |||
0515 | Find Largest Value in Each Tree Row | [Go]({{< relref "/ChapterFour/0500~0599/0515.Find-Largest-Value-in-Each-Tree-Row.md" >}}) | Medium | O(n) | O(n) | 62.7% | |
0526 | Beautiful Arrangement | [Go]({{< relref "/ChapterFour/0500~0599/0526.Beautiful-Arrangement.md" >}}) | Medium | 62.3% | |||
0529 | Minesweeper | [Go]({{< relref "/ChapterFour/0500~0599/0529.Minesweeper.md" >}}) | Medium | 62.0% | |||
0538 | Convert BST to Greater Tree | [Go]({{< relref "/ChapterFour/0500~0599/0538.Convert-BST-to-Greater-Tree.md" >}}) | Medium | 60.4% | |||
0542 | 01 Matrix | [Go]({{< relref "/ChapterFour/0500~0599/0542.01-Matrix.md" >}}) | Medium | O(n) | O(1) | 41.5% | |
0547 | Number of Provinces | [Go]({{< relref "/ChapterFour/0500~0599/0547.Number-of-Provinces.md" >}}) | Medium | 61.2% | |||
0563 | Binary Tree Tilt | [Go]({{< relref "/ChapterFour/0500~0599/0563.Binary-Tree-Tilt.md" >}}) | Easy | 53.7% | |||
0638 | Shopping Offers | [Go]({{< relref "/ChapterFour/0600~0699/0638.Shopping-Offers.md" >}}) | Medium | 53.6% | |||
0685 | Redundant Connection II | [Go]({{< relref "/ChapterFour/0600~0699/0685.Redundant-Connection-II.md" >}}) | Hard | 33.2% | |||
0690 | Employee Importance | [Go]({{< relref "/ChapterFour/0600~0699/0690.Employee-Importance.md" >}}) | Easy | 59.4% | |||
0695 | Max Area of Island | [Go]({{< relref "/ChapterFour/0600~0699/0695.Max-Area-of-Island.md" >}}) | Medium | 66.6% | |||
0721 | Accounts Merge | [Go]({{< relref "/ChapterFour/0700~0799/0721.Accounts-Merge.md" >}}) | Medium | 52.9% | |||
0733 | Flood Fill | [Go]({{< relref "/ChapterFour/0700~0799/0733.Flood-Fill.md" >}}) | Easy | 56.1% | |||
0753 | Cracking the Safe | [Go]({{< relref "/ChapterFour/0700~0799/0753.Cracking-the-Safe.md" >}}) | Hard | 52.8% | |||
0756 | Pyramid Transition Matrix | [Go]({{< relref "/ChapterFour/0700~0799/0756.Pyramid-Transition-Matrix.md" >}}) | Medium | 55.8% | |||
0778 | Swim in Rising Water | [Go]({{< relref "/ChapterFour/0700~0799/0778.Swim-in-Rising-Water.md" >}}) | Hard | 55.2% | |||
0783 | Minimum Distance Between BST Nodes | [Go]({{< relref "/ChapterFour/0700~0799/0783.Minimum-Distance-Between-BST-Nodes.md" >}}) | Easy | 54.5% | |||
0785 | Is Graph Bipartite? | [Go]({{< relref "/ChapterFour/0700~0799/0785.Is-Graph-Bipartite.md" >}}) | Medium | 49.0% | |||
0802 | Find Eventual Safe States | [Go]({{< relref "/ChapterFour/0800~0899/0802.Find-Eventual-Safe-States.md" >}}) | Medium | 50.4% | |||
0834 | Sum of Distances in Tree | [Go]({{< relref "/ChapterFour/0800~0899/0834.Sum-of-Distances-in-Tree.md" >}}) | Hard | 47.1% | |||
0839 | Similar String Groups | [Go]({{< relref "/ChapterFour/0800~0899/0839.Similar-String-Groups.md" >}}) | Hard | 42.4% | |||
0841 | Keys and Rooms | [Go]({{< relref "/ChapterFour/0800~0899/0841.Keys-and-Rooms.md" >}}) | Medium | 66.7% | |||
0851 | Loud and Rich | [Go]({{< relref "/ChapterFour/0800~0899/0851.Loud-and-Rich.md" >}}) | Medium | 53.1% | |||
0863 | All Nodes Distance K in Binary Tree | [Go]({{< relref "/ChapterFour/0800~0899/0863.All-Nodes-Distance-K-in-Binary-Tree.md" >}}) | Medium | 58.5% | |||
0872 | Leaf-Similar Trees | [Go]({{< relref "/ChapterFour/0800~0899/0872.Leaf-Similar-Trees.md" >}}) | Easy | 64.5% | |||
0897 | Increasing Order Search Tree | [Go]({{< relref "/ChapterFour/0800~0899/0897.Increasing-Order-Search-Tree.md" >}}) | Easy | 74.8% | |||
0924 | Minimize Malware Spread | [Go]({{< relref "/ChapterFour/0900~0999/0924.Minimize-Malware-Spread.md" >}}) | Hard | 41.8% | |||
0928 | Minimize Malware Spread II | [Go]({{< relref "/ChapterFour/0900~0999/0928.Minimize-Malware-Spread-II.md" >}}) | Hard | 41.6% | |||
0938 | Range Sum of BST | [Go]({{< relref "/ChapterFour/0900~0999/0938.Range-Sum-of-BST.md" >}}) | Easy | 83.4% | |||
0947 | Most Stones Removed with Same Row or Column | [Go]({{< relref "/ChapterFour/0900~0999/0947.Most-Stones-Removed-with-Same-Row-or-Column.md" >}}) | Medium | 55.8% | |||
0959 | Regions Cut By Slashes | [Go]({{< relref "/ChapterFour/0900~0999/0959.Regions-Cut-By-Slashes.md" >}}) | Medium | 67.5% | |||
0968 | Binary Tree Cameras | [Go]({{< relref "/ChapterFour/0900~0999/0968.Binary-Tree-Cameras.md" >}}) | Hard | 40.5% | |||
0971 | Flip Binary Tree To Match Preorder Traversal | [Go]({{< relref "/ChapterFour/0900~0999/0971.Flip-Binary-Tree-To-Match-Preorder-Traversal.md" >}}) | Medium | 49.9% | |||
0979 | Distribute Coins in Binary Tree | [Go]({{< relref "/ChapterFour/0900~0999/0979.Distribute-Coins-in-Binary-Tree.md" >}}) | Medium | 70.1% | |||
0980 | Unique Paths III | [Go]({{< relref "/ChapterFour/0900~0999/0980.Unique-Paths-III.md" >}}) | Hard | O(n log n) | O(n) | 77.1% | |
0987 | Vertical Order Traversal of a Binary Tree | [Go]({{< relref "/ChapterFour/0900~0999/0987.Vertical-Order-Traversal-of-a-Binary-Tree.md" >}}) | Hard | 39.2% | |||
1020 | Number of Enclaves | [Go]({{< relref "/ChapterFour/1000~1099/1020.Number-of-Enclaves.md" >}}) | Medium | 59.5% | |||
1026 | Maximum Difference Between Node and Ancestor | [Go]({{< relref "/ChapterFour/1000~1099/1026.Maximum-Difference-Between-Node-and-Ancestor.md" >}}) | Medium | 70.0% | |||
1028 | Recover a Tree From Preorder Traversal | [Go]({{< relref "/ChapterFour/1000~1099/1028.Recover-a-Tree-From-Preorder-Traversal.md" >}}) | Hard | 71.3% | |||
1038 | Binary Search Tree to Greater Sum Tree | [Go]({{< relref "/ChapterFour/1000~1099/1038.Binary-Search-Tree-to-Greater-Sum-Tree.md" >}}) | Medium | 82.9% | |||
1110 | Delete Nodes And Return Forest | [Go]({{< relref "/ChapterFour/1100~1199/1110.Delete-Nodes-And-Return-Forest.md" >}}) | Medium | 68.1% | |||
1123 | Lowest Common Ancestor of Deepest Leaves | [Go]({{< relref "/ChapterFour/1100~1199/1123.Lowest-Common-Ancestor-of-Deepest-Leaves.md" >}}) | Medium | 68.4% | |||
1145 | Binary Tree Coloring Game | [Go]({{< relref "/ChapterFour/1100~1199/1145.Binary-Tree-Coloring-Game.md" >}}) | Medium | 51.2% | |||
1203 | Sort Items by Groups Respecting Dependencies | [Go]({{< relref "/ChapterFour/1200~1299/1203.Sort-Items-by-Groups-Respecting-Dependencies.md" >}}) | Hard | 48.3% | |||
1254 | Number of Closed Islands | [Go]({{< relref "/ChapterFour/1200~1299/1254.Number-of-Closed-Islands.md" >}}) | Medium | 62.1% | |||
1302 | Deepest Leaves Sum | [Go]({{< relref "/ChapterFour/1300~1399/1302.Deepest-Leaves-Sum.md" >}}) | Medium | 85.4% | |||
1306 | Jump Game III | [Go]({{< relref "/ChapterFour/1300~1399/1306.Jump-Game-III.md" >}}) | Medium | 61.8% | |||
1319 | Number of Operations to Make Network Connected | [Go]({{< relref "/ChapterFour/1300~1399/1319.Number-of-Operations-to-Make-Network-Connected.md" >}}) | Medium | 55.5% | |||
1631 | Path With Minimum Effort | [Go]({{< relref "/ChapterFour/1600~1699/1631.Path-With-Minimum-Effort.md" >}}) | Medium | 50.2% | |||
------------ | ------------------------------------------------------- | ------- | ---------------- | --------------- | ------------- | ------------- | ------------- |