- 博客(13)
- 资源 (1)
- 收藏
- 关注
原创 Balanced Binary Tree-LeetCode
Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ
2014-10-29 15:22:11 467
原创 Minimum Depth of Binary Tree - LeetCode
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./** * Definition for binary tree *
2014-10-28 14:31:25 514
原创 Path Sum - LeetCode
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.For example:Given the below binary tree and sum
2014-10-28 11:25:48 428
原创 Pascal's Triangle - LeetCode
Given numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]]class Solution {public
2014-10-27 18:43:01 469
原创 Pascal's Triangle II -LeetCode
Given an index k, return the kth row of the Pascal's triangle.For example, given k = 3,Return [1,3,3,1].Note:Could you optimize your algorithm to use only O(k) extra space?
2014-10-27 18:28:55 356
原创 Longest Common Prefix-LeetCode
Write a function to find the longest common prefix string amongst an array of strings.
2014-10-27 15:05:18 407
原创 Valid Palindrome -LeetCode
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Panama" is a palindrome."race a car" is not a
2014-10-27 13:56:07 420
原创 Palindrome Number -LeetCode
Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (ie, -1)If you are thinking of converting th
2014-10-23 15:59:38 384
原创 Symmetric Tree-LeetCode
struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {}};bool issame(TreeNode *root1, TreeNode *root2){ if (root1 == NULL && ro
2014-10-22 16:25:31 431
原创 Count and Say-LeetCode
The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11 is read off as "two 1s" or 21.21 is read off as "o
2014-10-22 15:04:32 432
原创 String to Integer (atoi)-LeetCode
Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input case
2014-10-22 11:06:34 439
文件名批量修改
2014-10-22
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人