
BFS
文章平均质量分 83
dyllanzhou
这个作者很懒,什么都没留下…
展开
-
[Leetcode]Clone Graph
Clone an undirected graph. Each node in the graph contains a label and a list of itsneighbors.OJ's undirected graph serialization:Nodes are labeled uniquely.We use # as a separator for each原创 2015-11-05 21:25:37 · 272 阅读 · 0 评论 -
[Leetcode]Number of Islands
Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume原创 2015-09-01 12:38:40 · 292 阅读 · 0 评论 -
[Leetcode]Graph Valid Tree
Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair of nodes), write a function to check whether these edges make up a valid tree.For example:Given n =原创 2015-10-27 16:41:59 · 877 阅读 · 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 tr原创 2015-10-27 00:03:15 · 335 阅读 · 0 评论 -
[Leetcode]Word Ladder
Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence frombeginWord to endWord, such that:Only one letter can be changed at a原创 2015-11-25 17:05:54 · 282 阅读 · 0 评论 -
[Leetcode]Serialize and Deserialize Binary Tree
Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be原创 2015-12-28 20:17:08 · 347 阅读 · 0 评论