> For the complete documentation index, see [llms.txt](https://protegejj.gitbook.io/my-algorithm-summary/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://protegejj.gitbook.io/my-algorithm-summary/chapter1/depth-first-search.md).

# Depth-First Search

1. [Graph Valid Tree](https://leetcode.com/problems/graph-valid-tree/?tab=Description) (use List\<Set\<Integer>> instead of List\<List\<Integer>>, in order to remove key in undirected graph)
2. [Find Leaves of Binary Tree](https://leetcode.com/problems/find-leaves-of-binary-tree/?tab=Description) skills to get the height of node and add the node to the proper position using DFS

## 1. DFS in Matrix

## 2. DFS in Graph

## 3. DFS + Memoization
