Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 5.66 KB

bfs.md

File metadata and controls

39 lines (29 loc) · 5.66 KB

Breadth-First Search

Principe

Breadth-First Search (BFS) ou Parcours en largeur, est un algorithme utilisé pour parcourir ou rechercher des données dans un graphe ou un arbre.

L'idée principale est de visiter tout les voisins d'un noeud avant de passer aux voisins des voisins, cela signifie qu'il explore d'abord tous les noeuds à un niveau donnée avant de passer au niveau suivant.

Exemple animé de l'algorithme de parcours en largeur:

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

Moyen

Label Tags Date
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
542. 01 Matrix Array, Dynamic Programming, Breadth-First Search, Matrix 27-04-2024
623. Add One Row to Tree Tree, Depth-First Search, Breadth-First Search, Binary Tree 16-04-2024
752. Open the Lock Array, Hash Table, String, Breadth-First Search 22-04-2024
934. Shortest Bridge Array, Depth-First Search, Breadth-First Search, Matrix 29-03-2024
1609. Even Odd Tree Tree, Breadth-First Search, Binary Tree 29-02-2024
2812. Find the Safest Path in a Grid Array, Binary Search, Breadth-First Search, Union Find, Matrix 15-05-2024

Difficile

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