上一页 1 2 3 4 5 6 7 8 9 10 ··· 16 下一页

Leetcode: Binary Tree Maximum Path Sum

摘要: Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 ... 阅读全文
posted @ 2014-12-08 12:46 Ryan-Xing 阅读(172) 评论(0) 推荐(0) 编辑

Leetcode: Edit Distance

摘要: Given two wordsword1andword2, find the minimum number of steps required to convertword1toword2. (each operation is counted as 1 step.)You have the fol... 阅读全文
posted @ 2014-12-07 16:18 Ryan-Xing 阅读(126) 评论(0) 推荐(0) 编辑

Leetcode: Sort Colors

摘要: Given an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, wh... 阅读全文
posted @ 2014-12-07 15:36 Ryan-Xing 阅读(157) 评论(0) 推荐(0) 编辑

Leetcode: Word Search

摘要: Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjace... 阅读全文
posted @ 2014-12-07 00:47 Ryan-Xing 阅读(112) 评论(0) 推荐(0) 编辑

Leetcode: Intersection of Two Linked Lists

摘要: Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a... 阅读全文
posted @ 2014-12-06 20:22 Ryan-Xing 阅读(142) 评论(0) 推荐(0) 编辑

Leetcode: Generate Parentheses

摘要: Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))... 阅读全文
posted @ 2014-12-05 21:16 Ryan-Xing 阅读(181) 评论(0) 推荐(0) 编辑

Leetcode: Maximum Depth of Binary Tree

摘要: Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le... 阅读全文
posted @ 2014-12-05 19:55 Ryan-Xing 阅读(110) 评论(0) 推荐(0) 编辑

Leetcode: Pascal's Triangle II

摘要: Given an indexk, return thekthrow of the Pascal's triangle.For example, givenk= 3,Return[1,3,3,1].Note:Could you optimize your algorithm to use onlyO(... 阅读全文
posted @ 2014-12-05 17:07 Ryan-Xing 阅读(141) 评论(0) 推荐(0) 编辑

Leetcode: strStr()

摘要: Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.分析:该题是经典的串匹配,我们可以用KMP来解,时间... 阅读全文
posted @ 2014-12-05 15:40 Ryan-Xing 阅读(206) 评论(0) 推荐(0) 编辑

Leetcode: Binary Tree Postorder Traversal

摘要: Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[3,2,1].No... 阅读全文
posted @ 2014-12-04 20:51 Ryan-Xing 阅读(129) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 16 下一页