题目:Unique Binary Search TreesII 如果要列出所有可能的二叉搜索树,可以在上面的思路上进一步。 f(n) = f(0)*f(n-1) + f(1)*f(n-2) + ... + f(n-1)*f(0); 只要求出不同变量下的子树的所有情况,在整合到一起就可以了。 具体思路 ...
分类:
其他好文 时间:
2017-04-24 12:01:30
阅读次数:
174
A binary search tree is a binary tree. It may be empty. If it is not empty, it satisfies the following properties: (1) Every node has a key, and no tw ...
分类:
其他好文 时间:
2017-04-23 22:21:39
阅读次数:
241
1. 下载Windows Binary版本的node.js文件 2. 把下载的ZIP压缩包解压到某个目录下(例如:D:\nodejs) 3. 此时的node.js只在刚刚解压的目录才起作用,需要配置环境变量才能起到全局的作用。 1. 在此电脑(我的电脑)右击-属性-高级系统设置 2. 在弹出的窗口中 ...
1. 前言: 刷机,似乎是安卓手机用户的一项专利,可是,会刷机的用户一般都是喜新厌旧的角色。 一个系统用久了。就想换到还有一个系统。或者认为没有原来的好,或者又认为要换回去。这样又要重刷。 可是刷来刷去都麻烦啊,而且每次刷机也不是没有风险的,一不小心就可能造成关键数据的丢失。 没有解决的方法吗?有。 ...
分类:
移动开发 时间:
2017-04-23 13:20:04
阅读次数:
192
Given a binary tree, return the tilt of the whole tree.The tilt of a tree node is defined as the absolute difference between the sum of all left subtr ...
分类:
其他好文 时间:
2017-04-23 11:58:17
阅读次数:
165
本博客不再更新,很多其它精彩内容请訪问我的独立博客 1.折半查找的非递归算法 int BinarySearch(SeqList &L,DataType x) { int high=L.n-1,low=0,mid; while(low<=high){ mid=(low+high)/2; if(x.ke ...
分类:
其他好文 时间:
2017-04-23 10:50:45
阅读次数:
142
常见的几种对象及其属性和使用方法: (1).Array 对象 Array 对象用于在单个的变量中存储多个值。 创建 Array 对象的语法: new Array(); new Array(size); new Array(element0, element1, ..., elementn); 參数 ...
分类:
编程语言 时间:
2017-04-23 10:49:11
阅读次数:
222
Given an array where elements are sorted in ascending order, convert it to a height balanced BST. ...
分类:
其他好文 时间:
2017-04-23 00:56:06
阅读次数:
154
折半插入排序 折半插入排序(binary insertion sort)是对插入排序算法的一种改进,所谓排序算法过程,就是不断的依次将元素插入前面已排好序的序列中。 在将一个新元素插入已排好序的数组的过程中,寻找插入点时,将待插入区域的首元素设置为a[low],末元素设置为a[high],则轮比较时 ...
分类:
编程语言 时间:
2017-04-22 17:37:17
阅读次数:
153
class Solution { public: string addBinary(string a, string b) { int n = a.size() > b.size() ? a.size() : b.size(); reverse(a.begin(), a.end()); revers... ...
分类:
其他好文 时间:
2017-04-22 17:34:05
阅读次数:
105