depth-first search (DFS)
RU: поиск в глубину (DFS)
A graph traversal that follows each edge as far as possible before backtracking, visiting every vertex reachable from the start. It uses a visited set to avoid revisiting vertices, and runs recursively or with an explicit stack in O(V + E).