About 539,000 results
Open links in new tab
  1. Depth First Search or DFS for a Graph - GeeksforGeeks

    Mar 29, 2025 · In Depth First Search (or DFS) for a graph, we traverse all adjacent vertices one by one. When we traverse an adjacent vertex, we completely finish the traversal of all vertices reachable through that adjacent vertex.

  2. Depth First Search (DFS) Algorithm - Programiz

    Depth First Search is a recursive algorithm for searching all the vertices of a graph or tree data structure. In this tutorial, you will learn about the depth-first search with examples in Java, C, Python, and C++.

  3. Graph Traversal (Depth/Breadth First Search) - VisuAlgo

    Given a graph, we can use the O (V+E) DFS (Depth-First Search) or BFS (Breadth-First Search) algorithm to traverse the graph and explore the features/properties of the graph.

  4. Depth First Search (DFS) Algorithm - Online Tutorials Library

    Depth First Search (DFS) algorithm is a recursive algorithm for searching all the vertices of a graph or tree data structure. This algorithm traverses a graph in a depthward motion and uses a stack to remember to get the next vertex to start a search, when …

  5. Depth-first search - Wikipedia

    Depth-first search (DFS) is an algorithm for traversing or searching tree or graph data structures. The algorithm starts at the root node (selecting some arbitrary node as the root node in the case of a graph) and explores as far as possible along each branch before backtracking.

  6. Depth First Search or DFS for a Graph – Python - GeeksforGeeks

    Feb 21, 2025 · Python Depth First Search Algorithm is used for traversing or searching tree or graph data structures. The algorithm starts at the root node (selecting some arbitrary node as the root node in the case of a graph) and explores as far …

  7. Depth First Search (DFS) – Iterative and Recursive Implementation

    Oct 9, 2023 · Depth–first search (DFS) is an algorithm for traversing or searching tree or graph data structures. One starts at the root (selecting some arbitrary node as the root for a graph) and explore as far as possible along each branch before backtracking. The following graph shows the order in which the nodes are discovered in DFS:

  8. DFS Algorithm - Tpoint Tech

    In this article, we will discuss the DFS algorithm in the data structure. It is a recursive algorithm to search all the vertices of a tree data structure or a graph. The depth-first search (DFS) algorithm starts with the initial node of graph G and goes deeper until …

  9. Introduction to Depth First Search Algorithm (DFS) - Baeldung

    Mar 24, 2023 · In graph theory, one of the main traversal algorithms is DFS (Depth First Search). In this tutorial, we’ll introduce this algorithm and focus on implementing it in both the recursive and non-recursive ways.

  10. Depth First Search - DFS Algorithm with Practical Examples

    Depth First Search (DFS) is a basic but powerful way to explore a graph. It starts at a point and goes as far as it can along each branch before coming back and trying a different path. Think of it like exploring a maze, always going down one path until you hit a dead end, then backtracking to try another route.

  11. Some results have been removed
Refresh