Shortest distance in a graph

Name | Example |
---|---|

When BFS examine the target before pushing, or wait after poping at the next level? | |

What if starting and ending point is the same? | |

Initialize level with 0 or 1? |

Link: Why can’t DFS be used to find shortest paths in unweighted graphs?

See all series problems: #series

- Leetcode: Shortest Word Distance III
- Leetcode: Shortest Way to Form String
- Leetcode: Shortest Path with Alternating Colors
- Leetcode: Shortest Path Visiting All Nodes
- Leetcode: Shortest Path in Binary Matrix
- Leetcode: Shortest Distance to Target Color
- Leetcode: Shortest Distance to a Character

See more blog_posts.