
BFS
文章平均质量分 80
豆腐脑是咸的
这个作者很懒,什么都没留下…
展开
-
Binary Tree Zigzag Level Order Traversal (Java)
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).For example:Given binary原创 2014-12-31 14:58:21 · 339 阅读 · 0 评论 -
Surrounded Regions (Java)
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 X原创 2015-01-20 17:19:34 · 340 阅读 · 0 评论 -
Clone Graph (Java)
Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.OJ's undirected graph serialization:Nodes are labeled uniquely.We use # as a separator for ea原创 2015-01-20 09:33:39 · 418 阅读 · 0 评论 -
Binary Tree Level Order Traversal (Java)
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree {3,9,20,#,#,15,7}, 3 / \ 9 20原创 2014-12-24 20:29:01 · 354 阅读 · 0 评论 -
Binary Tree Level Order Traversal II (Java)
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For example:Given binary tree {3,9,20,#,#,15,7},原创 2014-12-24 20:41:37 · 390 阅读 · 0 评论 -
Word Ladder (Java)
Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that:Only one letter can be changed at a timeEach intermediate word m原创 2015-01-05 15:02:50 · 505 阅读 · 0 评论