[leetcode]Given an array where elements are sorted in ascending order, convert it to a height balanced BST....
分类:
其他好文 时间:
2014-10-08 10:09:55
阅读次数:
164
/**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
/**
* http...
分类:
其他好文 时间:
2014-10-08 01:05:04
阅读次数:
253
Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".详细一位一位地加即可了,考虑进位的问题。还有最后记得把生成的string反过来再返回,由于我们...
分类:
其他好文 时间:
2014-10-07 22:22:34
阅读次数:
174
安装环境:集群名pxc_lk节点1:192.168.1.20节点2:192.168.1.21节点3:192.168.1.22所有节点安装wgethttp://www.percona.com/redir/downloads/XtraBackup/LATEST/binary/redhat/6/x86_6...
分类:
数据库 时间:
2014-10-07 19:53:44
阅读次数:
366
问题: Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identic...
分类:
其他好文 时间:
2014-10-07 17:55:43
阅读次数:
127
struct TreeNode{ int val; TreeNode* left; TreeNode* right; TreeNode(int val):val(val),left(NULL),right(NULL){}};Not all binary trees are bina...
分类:
其他好文 时间:
2014-10-07 15:02:23
阅读次数:
221
过去只是人生经历,并不是人生负担[问题描述]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 bi...
分类:
其他好文 时间:
2014-10-07 13:47:03
阅读次数:
195
问题一:ubuntu eclipse c++ launch failed binary not found
解决:建完项目后 查看在项目中是不是有debug文件夹,说明没有编译,只是需要做如下操作 Project ->Build Poject 构建项目,这是应该会出现debug文件,这时你的程序就可以运行了...
分类:
系统相关 时间:
2014-10-07 10:02:53
阅读次数:
148
大象放入冰箱几步的思路处理这问题就好了
1.把左子树弄平, 2. 插入到根节点和根节点的右子树之间,3. 重复1,2
思路不难,代码上有点混乱,细节实现是:把root的左子树弄成flatten的 flatten(root.left),把右子树保存起来 temp=root.right,让root.right=root.left, 然后断掉左边,root.left=null.
然后一直走到右边的...
分类:
其他好文 时间:
2014-10-07 06:20:13
阅读次数:
194
题目链接:http://poj.org/problem?id=2499思路: 结点向左边移动时结点(a, b)变为( a+b, b),向右边移动时( a, b )变为( a, a + b); 为求最短路径,考虑从已经知道的结点(a, b)开始找出最短路径回到根节点(1, 1); 即向左移动次数...
分类:
其他好文 时间:
2014-10-06 23:44:30
阅读次数:
166