Depth-First Search (DFS) ou Parcours en profondeur, est un algorithme utilisé pour parcourir ou rechercher des données dans un graphe ou un arbre.
L'idée principale est de visiter le plus profondément possible le long d'une branche avant de revenir en arrière pour explorer d'autres branches.
Exemple animé de l'algorithme de parcours en profondeur:
Label | Tags | Date |
---|---|---|
100. Same Tree | Tree , Depth-First Search , Breadth-First Search , Binary Tree |
26-02-2024 |
104. Maximum Depth of Binary Tree | Tree , Depth-First Search , Breadth-First Search , Binary Tree |
31-03-2024 |
226. Invert Binary Tree | Tree , Depth-First Search , Breadth-First Search , Binary Tree |
31-03-2024 |
404. Sum of Left Leaves | Tree , Depth-First Search , Breadth-First Search , Binary Tree |
15-04-2024 |
463. Island Perimeter | Array , Depth-First Search , Breadth-First Search , Matrix |
27-04-2024 |
543. Diameter of Binary Tree | Tree , Depth-First Search , Binary Tree |
27-02-2024 |
Label | Tags | Date |
---|---|---|
2092. Find All People With Secret | Depth-First Search , Breadth-First Search , Union Find , Graph , Sorting |
24-02-2024 |