Depth First Search
No.
Title
Solution
Difficulty
TimeComplexity
SpaceComplexity
Favorite
Acceptance
0017
Letter Combinations of a Phone Number
Medium
48.8%
0098
Validate Binary Search Tree
Medium
O(n)
O(1)
28.6%
0099
Recover Binary Search Tree
Hard
O(n)
O(1)
42.2%
0100
Same Tree
Easy
O(n)
O(1)
54.0%
0101
Symmetric Tree
Easy
O(n)
O(1)
47.9%
0104
Maximum Depth of Binary Tree
Easy
O(n)
O(1)
67.8%
0105
Construct Binary Tree from Preorder and Inorder Traversal
Medium
51.4%
0106
Construct Binary Tree from Inorder and Postorder Traversal
Medium
49.3%
0108
Convert Sorted Array to Binary Search Tree
Easy
O(n)
O(1)
60.1%
0109
Convert Sorted List to Binary Search Tree
Medium
O(log n)
O(n)
49.9%
0110
Balanced Binary Tree
Easy
O(n)
O(1)
44.6%
0111
Minimum Depth of Binary Tree
Easy
O(n)
O(1)
39.3%
0112
Path Sum
Easy
O(n)
O(1)
42.2%
0113
Path Sum II
Medium
O(n)
O(1)
48.7%
0114
Flatten Binary Tree to Linked List
Medium
O(n)
O(1)
51.5%
0124
Binary Tree Maximum Path Sum
Hard
O(n)
O(1)
35.3%
0129
Sum Root to Leaf Numbers
Medium
O(n)
O(1)
50.6%
0130
Surrounded Regions
Medium
29.2%
0131
Palindrome Partitioning
Medium
51.5%
0199
Binary Tree Right Side View
Medium
O(n)
O(1)
55.8%
0200
Number of Islands
Medium
O(n^2)
O(n^2)
48.7%
0207
Course Schedule
Medium
O(n^2)
O(n^2)
44.3%
0210
Course Schedule II
Medium
O(n^2)
O(n^2)
42.3%
0211
Design Add and Search Words Data Structure
Medium
39.9%
0257
Binary Tree Paths
Easy
O(n)
O(1)
53.3%
0329
Longest Increasing Path in a Matrix
Hard
44.5%
0337
House Robber III
Medium
51.7%
0394
Decode String
Medium
O(n)
O(n)
52.4%
0491
Increasing Subsequences
Medium
47.4%
0494
Target Sum
Medium
45.8%
0513
Find Bottom Left Tree Value
Medium
62.4%
0515
Find Largest Value in Each Tree Row
Medium
O(n)
O(n)
62.1%
0526
Beautiful Arrangement
Medium
61.7%
0529
Minesweeper
Medium
60.8%
0542
01 Matrix
Medium
O(n)
O(1)
40.7%
0547
Number of Provinces
Medium
60.2%
0563
Binary Tree Tilt
Easy
52.7%
0638
Shopping Offers
Medium
52.7%
0685
Redundant Connection II
Hard
32.9%
0695
Max Area of Island
Medium
64.4%
0721
Accounts Merge
Medium
51.3%
0733
Flood Fill
Easy
55.8%
0753
Cracking the Safe
Hard
52.1%
0756
Pyramid Transition Matrix
Medium
55.4%
0778
Swim in Rising Water
Hard
54.5%
0785
Is Graph Bipartite?
Medium
48.2%
0802
Find Eventual Safe States
Medium
49.7%
0834
Sum of Distances in Tree
Hard
45.6%
0839
Similar String Groups
Hard
40.2%
0841
Keys and Rooms
Medium
65.3%
0851
Loud and Rich
Medium
52.5%
0863
All Nodes Distance K in Binary Tree
Medium
57.6%
0872
Leaf-Similar Trees
Easy
64.6%
0897
Easy
74.4%
0924
Minimize Malware Spread
Hard
41.8%
0928
Minimize Malware Spread II
Hard
41.2%
0947
Most Stones Removed with Same Row or Column
Medium
55.5%
0959
Regions Cut By Slashes
Medium
66.9%
0968
Binary Tree Cameras
Hard
38.5%
0979
Distribute Coins in Binary Tree
Medium
69.5%
0980
Unique Paths III
Hard
O(n log n)
O(n)
77.2%
1020
Number of Enclaves
Medium
58.7%
1026
Maximum Difference Between Node and Ancestor
Medium
69.2%
1028
Recover a Tree From Preorder Traversal
Hard
70.8%
1110
Delete Nodes And Return Forest
Medium
67.6%
1123
Lowest Common Ancestor of Deepest Leaves
Medium
67.9%
1145
Binary Tree Coloring Game
Medium
51.4%
1203
Sort Items by Groups Respecting Dependencies
Hard
49.1%
1254
Number of Closed Islands
Medium
61.5%
1302
Deepest Leaves Sum
Medium
84.1%
1306
Jump Game III
Medium
62.6%
1319
Number of Operations to Make Network Connected
Medium
55.1%
------------
-------------------------------------------------------
-------
----------------
---------------
-------------
-------------
-------------
Last updated
Was this helpful?