DFS
文章平均质量分 85
yuanhisn
这个作者很懒,什么都没留下…
展开
-
LeetCode 126 - Word Ladder II
Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that: Only one letter can be changed at a time Each intermediate word must ...原创 2015-03-02 08:12:17 · 47 阅读 · 0 评论 -
Find if there is a path between two vertices in a directed graph
Given a Directed Graph and two vertices in it, check whether there is a path from the first given vertex to second. For example, in the following graph, there is a path from vertex 1 to 3. As anothe...原创 2015-05-02 23:00:02 · 112 阅读 · 0 评论 -
LeetCode 210 - Course Schedule II
There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a p...原创 2015-05-26 14:09:27 · 54 阅读 · 0 评论 -
LeetCode 212 - Word Search II
Given a 2D board and a list of words from the dictionary, find all words in the board. Each word must be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those hor...原创 2015-06-08 23:53:53 · 65 阅读 · 0 评论 -
Google Interview - Flowing Water
Given a N*N matrix contains lakes, each lake is represented by an elevation. The water in each lake can flow to its neighbours which has lower or equal elevations. Suppose the left and top side of t...原创 2015-06-15 09:19:59 · 60 阅读 · 0 评论 -
Find Islands
Given matrix MxN of 0s and 1s, return and output all groups of adjacent 1s in form of (row,col)... 1s are considered adjacent if they are adjacent horizontally or vertically. 1 1 0 1 0 1 1 1 1 1 ...原创 2015-06-24 11:22:07 · 97 阅读 · 0 评论