level: graph-traversal algorithms + dystraks shortest path alg
Questions and Answers List
level questions: graph-traversal algorithms + dystraks shortest path alg
Question | Answer |
---|---|
What are the two types of graph-traversal algorithms | Breadth first Depth first |
What is depth first commonly used for | Depth-first: Navigating a maze. |
Whats breadth first commonly used for | Breadth-first: shortest path for an unweighted graph. |
How does breadth first work | Start with a vertex and print its value. Then we print all the neighbors of the current vertex. After that, we select every neighbor of the current vertex and print all of its neighbors |
How does depth first work | The algorithm starts at the root (top) node of a tree and goes as far as it can down a given branch (path), then backtracks until it finds an unexplored path, and then explores it. The algorithm does this until the entire graph has been explored. |
What is a applicaiton of Dystras shortest path algorothm | GPS devices |