Breadth First Search
文章平均质量分 79
所难
这个作者很懒,什么都没留下…
展开
-
LeetCode-Word Ladder
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原创 2014-07-31 14:48:02 · 473 阅读 · 0 评论 -
LeetCode-Minimum Depth of Binary Tree
Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.Solution:Code:原创 2014-08-03 20:21:11 · 205 阅读 · 0 评论 -
LeetCode-Binary Tree Level Order Traversal II
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-08-04 08:10:04 · 226 阅读 · 0 评论 -
LeetCode-Binary Tree Level Order Traversal
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-08-04 14:55:07 · 169 阅读 · 0 评论 -
LeetCode-Binary Tree Zigzag Level Order Traversal
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-08-04 14:44:57 · 212 阅读 · 0 评论