随笔分类 -  bfs

[leecode]Clone Graph
摘要:Clone GraphClone an undirected graph. Each node in the graph contains alabeland a list of itsneighbors.OJ's undirected graph serialization:Nodes are l... 阅读全文

posted @ 2014-08-25 20:55 喵星人与汪星人 阅读(180) 评论(0) 推荐(0) 编辑

[leetcode]Binary Tree Level Order Traversal II
摘要:Binary Tree Level Order Traversal IIGiven a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level... 阅读全文

posted @ 2014-08-08 21:35 喵星人与汪星人 阅读(143) 评论(0) 推荐(0) 编辑

[leetcode]Binary Tree Level Order Traversal
摘要:Binary Tree Level Order TraversalGiven a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).Fo... 阅读全文

posted @ 2014-08-08 21:26 喵星人与汪星人 阅读(254) 评论(0) 推荐(0) 编辑

[leetcode]Binary Tree Zigzag Level Order Traversal
摘要:Binary Tree Zigzag Level Order TraversalGiven a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then... 阅读全文

posted @ 2014-08-08 21:11 喵星人与汪星人 阅读(208) 评论(0) 推荐(0) 编辑

[leetcode]Surrounded Regions
摘要:Surrounded RegionsGiven a 2D board containing'X'and'O', capture all regions surrounded by'X'.A region is captured by flipping all'O's into'X's in that... 阅读全文

posted @ 2014-08-07 21:02 喵星人与汪星人 阅读(606) 评论(0) 推荐(0) 编辑

[leetcode]Populating Next Right Pointers in Each Node II
摘要:Populating Next Right Pointers in Each Node IIFollow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any ... 阅读全文

posted @ 2014-07-31 20:40 喵星人与汪星人 阅读(174) 评论(0) 推荐(0) 编辑

[leetcode]Populating Next Right Pointers in Each Node
摘要:Populating Next Right Pointers in Each NodeGiven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLi... 阅读全文

posted @ 2014-07-31 20:35 喵星人与汪星人 阅读(246) 评论(0) 推荐(0) 编辑