Given an array where elements are sorted in
ascending order, convert it to a height balanced BST./** * Definition for binary
tree * public class TreeN...
分类:
其他好文 时间:
2014-06-11 21:58:10
阅读次数:
300
题目链接题意: 给定一棵二叉树, 判断是否为平衡二叉树, 这里的平衡二叉树指的是:每个结点的左右子树的深度之差不超过1。附上代码:
1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * ...
分类:
其他好文 时间:
2014-06-08 18:58:35
阅读次数:
194
题目链接求二叉树最小深度,最小深度指的是:从根节点走到最近的叶子结点的最短长度附上代码: 1 /**
2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode
*left; 6...
分类:
其他好文 时间:
2014-06-08 18:43:48
阅读次数:
220
1. 递归解法
/**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
cl...
分类:
其他好文 时间:
2014-06-08 16:51:59
阅读次数:
199
有时候我们展示给用户的表单中的checkbox,radio,selec等标签的一些项是默认选中的。比如:当用户修改文章的时候,如果对应的栏目为下拉框的话,那么它的默认选中值应该是原来的栏目位置。
可以使用jquery中的val()方法给select、checkbox、radio设置默认选中项。
对于multiple类型的select和checkbox还可以设置多个默认值。
效果图:
...
分类:
其他好文 时间:
2014-06-08 16:16:19
阅读次数:
233
POJ 2356 find multiple
题意:
输入一个正整数 N ,接着输入 N 和 正整数 nums[1], nums[2], ... ... , nums[N],
试问可否从这 N 个正整数中找出一组连续的数,它们的和能被 N 整除。
思路:
鸽巢原理,构造一个序列 sums[1] = nums[1], sums[2] = nums[1] + nums[2], ... ....
分类:
其他好文 时间:
2014-06-08 15:12:34
阅读次数:
213
MDI窗体设计:(Multiple-Document Interface)
用途:用于同时显示多个文档,每个文档显示在各自的窗体中。
起到容器作用的窗体被称为"父窗体",可放在父窗体中的其他窗体称为"子窗体",也称为"MDI子窗体"。每个应用程序只能有一个父窗体,并且其他子窗体不能移出父窗体的框架区域。
1.设置父窗体:在窗体的属性面板 将IsMdiContainer属性设置为True即可...
Definition
Let be "0" and
be "01". Now (the concatenation of the previous sequence and the one before that).
The infinite Fibonacci word is the limit
We have:
0
01
010
01...
分类:
其他好文 时间:
2014-06-08 09:19:42
阅读次数:
273
易飞后台采用SQL
SERVER数据库。要跟踪数据库,可以按以下步骤进行。一、建立BED应用程序名称。路径:WINDOWS开始菜单|程序|神州数据易飞ERP系统|BDEAMIN.在database页面中,选中Leader,将右边框中Definition中的APPLICATION
NAME设置为“TT...
分类:
数据库 时间:
2014-06-07 21:28:43
阅读次数:
372
Variablesvar myInt = 1var myExplicitInt: Int = 1 //
explicit typevar x = 1, y = 2, z = 3 // declare multiple integersmyExplicitInt =
2 // set to anoth...
分类:
移动开发 时间:
2014-06-07 17:03:36
阅读次数:
357