随笔分类 -  BFS

摘要:http://www.cnblogs.com/shawnhue/archive/2013/06/05/leetcode_126.htmlhttp://fisherlei.blogspot.com/2013/02/leetcode-word-ladder-ii-solution.htmlhttp://blog.csdn.net/niaokedaoren/article/details/8884938 1 class Node { 2 int no; 3 String val; 4 LinkedList prev; 5 6 Node(int no,... 阅读全文
posted @ 2014-03-07 02:55 Razer.Lu 阅读(266) 评论(0) 推荐(0)
摘要:Clone an undirected graph. Each node in the graph contains alabeland a list of itsneighbors.OJ's undirected graph serialization:Nodes are labeled uniquely.We use#as a separator for each node, and,as a separator for node label and each neighbor of the node.As an example, consider the serialized g 阅读全文
posted @ 2014-02-18 02:43 Razer.Lu 阅读(285) 评论(0) 推荐(0)
摘要:Given 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 surrounded region .For example,X X X XX O O XX X O XX O X XAfter running your function, the board should be:X X X XX X X XX X X 阅读全文
posted @ 2014-02-04 14:23 Razer.Lu 阅读(233) 评论(0) 推荐(0)
摘要:Given two words (startandend), and a dictionary, find the length of shortest transformation sequence fromstarttoend, such that:Only one letter can be ... 阅读全文
posted @ 2014-01-26 16:50 Razer.Lu 阅读(227) 评论(0) 推荐(0)