Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 7.23 KB

dfs.md

File metadata and controls

42 lines (32 loc) · 7.23 KB

Depth-First Search

Principe

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:

Facile

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

Moyen

Label Tags Date
129. Sum Root to Leaf Numbers Tree, Depth-First Search, Binary Tree 15-04-2024
200. Number of Islands Array, Depth-First Search, Breadth-First Search, Union Find, Matrix 19-04-2024
513. Find Bottom Left Tree Value Tree, Depth-First Search, Breadth-First Search, Binary Tree 28-02-2024
538. Convert BST to Greater Tree Tree, Depth-First Search, Binary Search Tree, Binary Tree 25-06-2024
623. Add One Row to Tree Tree, Depth-First Search, Breadth-First Search, Binary Tree 16-04-2024
934. Shortest Bridge Array, Depth-First Search, Breadth-First Search, Matrix 29-03-2024
988. Smallest String Starting From Leaf String, Tree, Depth-First Search, Binary Tree 17-01-2024
1038. Binary Search Tree to Greater Sum Tree Tree, Depth-First Search, Binary Search Tree, Binary Tree 25-06-2024
1110. Delete Nodes And Return Forest Array, Hash Table, Tree, Depth-First Search, Binary Tree 17-07-2024
1382. Balance a Binary Search Tree Divide and Conquer, Greedy, Tree, Depth-First Search, Binary Search Tree, Binary Tree 26-06-2024

Difficile

Label Tags Date
2092. Find All People With Secret Depth-First Search, Breadth-First Search, Union Find, Graph, Sorting 24-02-2024