Solution for Depth-first Search


10
28
9
# Name Difficulty Tags
98 Validate Binary Search Tree Medium Tree | Depth-first Search
99 Recover Binary Search Tree Hard Tree | Depth-first Search
100 Same Tree Easy Tree | Depth-first Search
101 Symmetric Tree Easy Tree | Depth-first Search | Breadth-first Search
104 Maximum Depth of Binary Tree Easy Tree | Depth-first Search
105 Construct Binary Tree from Preorder and Inorder Traversal Medium Array | Tree | Depth-first Search
106 Construct Binary Tree from Inorder and Postorder Traversal Medium Array | Tree | Depth-first Search
108 Convert Sorted Array to Binary Search Tree Easy Tree | Depth-first Search
110 Balanced Binary Tree Easy Tree | Depth-first Search
112 Path Sum Easy Tree | Depth-first Search
113 Path Sum II Medium Tree | Depth-first Search
114 Flatten Binary Tree to Linked List Medium Tree | Depth-first Search
116 Populating Next Right Pointers in Each Node Medium Tree | Depth-first Search
117 Populating Next Right Pointers in Each Node II Medium Tree | Depth-first Search
124 Binary Tree Maximum Path Sum Hard Tree | Depth-first Search
129 Sum Root to Leaf Numbers Medium Tree | Depth-first Search
130 Surrounded Regions Medium Depth-first Search | Breadth-first Search | Union Find
199 Binary Tree Right Side View Medium Tree | Depth-first Search | Breadth-first Search
257 Binary Tree Paths Easy Tree | Depth-first Search
337 House Robber III Medium Tree | Depth-first Search
366 Find Leaves of Binary Tree Medium Tree | Depth-first Search
513 Find Bottom Left Tree Value Medium Tree | Depth-first Search | Breadth-first Search
515 Find Largest Value in Each Tree Row Medium Tree | Depth-first Search | Breadth-first Search
559 Maximum Depth of N-ary Tree Easy Tree | Depth-first Search | Breadth-first Search
834 Sum of Distances in Tree Hard Tree | Depth-first Search
863 All Nodes Distance K in Binary Tree Medium Tree | Depth-first Search | Breadth-first Search
872 Leaf-Similar Trees Easy Tree | Depth-first Search
897 Increasing Order Search Tree Easy Tree | Depth-first Search
968 Binary Tree Cameras Hard Dynamic Programming | Tree | Depth-first Search
971 Flip Binary Tree To Match Preorder Traversal Medium Tree | Depth-first Search
979 Distribute Coins in Binary Tree Medium Tree | Depth-first Search
988 Smallest String Starting From Leaf Medium Tree | Depth-first Search
1026 Maximum Difference Between Node and Ancestor Medium Tree | Depth-first Search
1028 Recover a Tree From Preorder Traversal Hard Tree | Depth-first Search
1110 Delete Nodes And Return Forest Medium Tree | Depth-first Search
1123 Lowest Common Ancestor of Deepest Leaves Medium Tree | Depth-first Search
1145 Binary Tree Coloring Game Medium Tree | Depth-first Search
1192 Critical Connections in a Network Hard Depth-first Search
1203 Sort Items by Groups Respecting Dependencies Hard Depth-first Search | Graph | Topological Sort
1245 Tree Diameter Medium Tree | Depth-first Search | Breadth-first Search
1302 Deepest Leaves Sum Medium Tree | Depth-first Search
1315 Sum of Nodes with Even-Valued Grandparent Medium Tree | Depth-first Search
1319 Number of Operations to Make Network Connected Medium Depth-first Search | Breadth-first Search | Union Find
1376 Time Needed to Inform All Employees Medium Depth-first Search
1377 Frog Position After T Seconds Hard Depth-first Search
1391 Check if There is a Valid Path in a Grid Medium Depth-first Search | Breadth-first Search
1766 Tree of Coprimes Hard Math | Tree | Depth-first Search | Breadth-first Search