广度优先搜索
文章平均质量分 74
tangyifei1991
这个作者很懒,什么都没留下…
展开
-
Word Ladder 单词台阶
class Solution { public: int ladderLength(string start, string end, unordered_set &dict) { unordered_map father; unordered_set isvisited; queue current,next;原创 2014-01-20 19:57:13 · 499 阅读 · 0 评论 -
Surrounded Regions 被包围的区域
class Solution { public: void process(int i,int j,vector> &board) { int m=board.size(); int n=board[0].size(); typedef pair point; queue q; q.pu原创 2014-01-20 20:10:49 · 400 阅读 · 0 评论 -
Word Ladder II 单词台阶II,求路径
class Solution { public: void generatepath(unordered_map>&father,string start,string word,vector &path,vector>&result) { path.push_back(word); if(word==start) {原创 2014-01-20 20:04:44 · 348 阅读 · 0 评论