Depth First Search [DFS]¶
How To: Depth First Search [DFS]
Path sum
Path sum II
Binary tree right side view
Number of islands
Lowest common ancestor (LCA) of a binary tree
Strobogrammatic number II
Count univalue subtrees
Binary tree paths
Expression add operators
Remove invalid parentheses
Longest increasing path in a matrix
Reconstruct itinerary
Nested list weight sum
Nested list weight sum II
Find leaves of binary tree
Evaluate division
Pacific Atlantic water flow
K-th smallest in lexicographical order
Can I win
Find largest value in each tree row
Friend circles [Union Find]
Kill process [DFS, BFS]
Shopping offers
Employee importance [DFS, BFS]
Number of distinct islands
Max area of island
Number of distinct islands II [Hash]
Flood Fill
Contain virus [Simulation]
Cracking the safe [de Bruijn sequences, Lyndon word]
Pyramid transition matrix
Is graph bipartite?
All paths from source to target
Find eventual safe states
Making a large island
Sum of distances in tree
Keys and rooms
Loud and rich
Cat and mouse
Number of enclaves
All paths from source lead to destination
Critical connections in a network [Tarjan’s Alg, Bridge Finding Alg]
Smallest string with swaps [Union Find]
Number of closed islands
Delete tree node [DFS, DP]
Sum of nodes with even-valued grandparent
Number of operations to make network connected [Union Find]
Linked list in binary tree [KMP Algorithm]
Longest zigzag path in a binary tree
Time needed to inform all employees
Frog position after T seconds [DFS, Stack, BFS]
Check if there is a valid path in a grid [Simulation]