SVN的merge操作是为了保证主干(trunk)和分支(branch)同步,merge方式有:1、Merge a range of revisions(合并一个范围的版本)2、Reintegrate a branch(复兴合并)3、Merge two different trees(合并两个不同的...
分类:
其他好文 时间:
2014-09-27 14:49:09
阅读次数:
183
1 #include 2 #include 3 #include 4 #include 5 #include 6 7 using namespace std; 8 9 class Node {10 public:11 int val;12 Node* left;13 ...
分类:
其他好文 时间:
2014-09-27 13:39:29
阅读次数:
180
这一题和Permutation II很像,一个是排列一个是组合。
我们理清思路,从最基本的获取子集的方法开始分析:
获取子集总的来说可以用循环或者递归做,同时还可以根据数字对应的binary code得到。
例如s = {x,y,z}可以生成的组合有:x,y,z,xy,yz,xz,xyz,0
第一种思路:
1. 维护一个集合Set(i),包含s[0...i]可生成的所有组合
s...
分类:
其他好文 时间:
2014-09-27 00:19:18
阅读次数:
368
原来iTunes Connect 的 reject binary 改变为 remove this version from review
这个状态会在你submit for review 后大概半小时才出现。...
分类:
其他好文 时间:
2014-09-26 23:41:58
阅读次数:
328
在递归函数中,加上max和min,保存当前子树的最大值和最小值
合法的二叉查找树:
1.左子树最大值
2.右子树最小值>根节点
3.子树均为合法的BST
bool isValidBST(TreeNode *root) {
if (!root) return true;
int max, min;
return isValid(root, m...
分类:
其他好文 时间:
2014-09-26 20:54:38
阅读次数:
131
Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 1 /** 2 * Definition for binary tree 3 * public cl.....
分类:
其他好文 时间:
2014-09-26 13:49:58
阅读次数:
154
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...
分类:
其他好文 时间:
2014-09-26 12:57:38
阅读次数:
204
最近在项目中遇到长时间反复启动结束一个activity是会出现崩溃的情况,错误报告:android.view.InflateException: Binary XML file line ...Error inflating class 查询资料有大神说是内存溢出(http://stackoverf...
分类:
移动开发 时间:
2014-09-26 12:43:48
阅读次数:
223
主要的思想类似中序遍历,先构建左子树,再构建当前节点,并构建右子树
TreeNode *sortedListToBST(ListNode *head) {
int count = 0;
ListNode * cur = head;
while (cur)
{
count++;
cu...
分类:
其他好文 时间:
2014-09-26 11:41:08
阅读次数:
230
一:平衡二叉树特点:平衡二叉树(Balanced binary tree)是由阿德尔森-维尔斯和兰迪斯(Adelson-Velskii and Landis)于1962年首先提出的,所以又称为AVL树。定义:平衡二叉树或为空树,或为如下性质的二叉排序树: (1)左右子树深度之差的绝对值不超过1; (...
分类:
其他好文 时间:
2014-09-25 22:12:17
阅读次数:
284