摘要:
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 ca... 阅读全文
摘要:
一个笨办法用两个Queue实现:/** * Definition for binary tree * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; ... 阅读全文
摘要:
GivennumRows, generate the firstnumRowsof Pascal's triangle.Java:public class Solution { public List> generate(int numRows) { List> result =... 阅读全文
摘要:
Given a linked list, determine if it has a cycle in it. (Without using eatra space)//Solution: define two pointers, one moves one step each time while... 阅读全文
摘要:
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Ja... 阅读全文
摘要:
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 le... 阅读全文