- 博客(5)
- 资源 (2)
- 收藏
- 关注
原创 [leetcode] 96. Unique Binary Search Trees
题目: Given n, how many structurally unique BST’s (binary search trees) that store values 1…n?For example, Given n = 3, there are a total of 5 unique BST’s.思路: 当n = 1 时 BST的个数是1; 当n = 2 时 BST的个数是2;
2016-07-22 17:18:04 187
原创 [leetcode] 376. Wiggle Subsequence
题目:A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) may be either p
2016-07-22 15:57:54 546
原创 [leetcode] 101. Symmetric Tree
题目: leetcode 链接思路:分别判断对称位置的值是否相同,即根节点的左子树的左节点和右子树的右节点 与 左子树的右节点和右子树的左节点是否都相同。并依次按左子树的左节点和右子树的右节点 左子树的右节点和右子树的左节点深入比较下去。递归代码:/** * Definition for a binary tree node. * public class TreeNode { *
2016-07-18 10:56:34 217
原创 [leetcode] 107. 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,null,null,15,7],
2016-07-18 10:12:01 234
原创 [leetcode] 198. House Robber
题目: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent h
2016-07-18 08:33:28 254
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人