判断一棵树是不是平衡二叉树,之前做过,还有点印象,用一个函数返回树的高度,如果是-1的话,就说明子树不平衡。1A很开心~ 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * T...
分类:
其他好文 时间:
2014-07-07 13:56:05
阅读次数:
180
Problem Description:Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tre...
分类:
其他好文 时间:
2014-07-07 13:27:35
阅读次数:
207
树状数组树状数组(Binary Indexed Tree(BIT), Fenwick Tree)是一个查询和改动复杂度都为log(n)的数据结构。主要用于查询随意两位之间的全部元素之和,可是每次仅仅能改动一个元素的值;经过简单改动能够在log(n)的复杂度下进行范围改动,可是这时仅仅能查询当中一个元...
分类:
其他好文 时间:
2014-07-07 13:13:05
阅读次数:
166
大家可以去我的Githup下载 https://github.com/simplyou/YJ-UIIView-/tree/master在设置尺寸的时候亲们有没有感觉很蛋疼啊,这里提供了一套分类,直接放进工程里,在PCH中包含头文件就能解决你蛋疼的问题;/**********************....
分类:
移动开发 时间:
2014-07-03 11:51:43
阅读次数:
352
Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100". 1 class Solution 2 { 3 public: 4 ...
分类:
其他好文 时间:
2014-07-03 11:23:54
阅读次数:
164
安装步骤:1、下载aptana3.2 Eclipse Plugin插件.下载地址:http://update1.aptana.org/studio/3.2/024747/index.html2、在java文件夹下新建文件夹pluginsNew,在里面新建aptana_update_024747文件夹...
分类:
系统相关 时间:
2014-07-03 11:05:43
阅读次数:
290
在做Web开发时,都会遇到将后台的数据显示在前台页面的情况。几种比较典型的应用实例:方法1:后台代码:namespace WebApplication3{ public partial class Index : System.Web.UI.Page { public string name = "...
分类:
其他好文 时间:
2014-06-30 20:31:59
阅读次数:
162
题目
Given a binary tree, flatten it to a linked list in-place.
For example,
Given
1
/ 2 5
/ \ 3 4 6
The flattened tree should look lik...
分类:
其他好文 时间:
2014-06-30 18:13:31
阅读次数:
229
直接上代码
ZeroClipboard Test
.line {
margin-bottom: 20px;
}
/* 复制提示 */
.copy-tips {
position: fixed;
z-index: 9999;
bottom: 50%;
left: 50%;
margin: 0 0 -20px -80px;
background-color: rgba(0,...
分类:
其他好文 时间:
2014-06-30 17:42:43
阅读次数:
318
作为一个oracle dba有时候不得不管理一下mysql数据库,当为主从库时需要阶段性清理mysql binary log,清楚方式如下:
首先查看mysql 的当前日志组
show master status;
确定当前日志组后删除日志文件
purge binary logs to 'mysql-bin.000795';
删除000795之前的日志...
分类:
数据库 时间:
2014-06-30 17:16:01
阅读次数:
240