题目
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).
For example:
Given binary tree {3,9,20,#,#...
分类:
其他 时间:
2014-03-12 22:51:52
收藏:
0 评论:
0 赞:
0 阅读:
477
@上一节中,cell的行高是我们自己定义的,但是在实际开发过程中,我们一开始并不能预知道cell的高度,因为我们并不能知道我们写进的数据在手机屏幕中能有多少行,如果不进行设置,则会变成下面图示情况:(右边的是加入了//
不限制文本行数_label.numberOfLines = 0 和 // 换行模式_label.lineBreakMode = NSLineBreakByWordWrappin...
分类:
其他 时间:
2014-03-12 22:01:20
收藏:
0 评论:
0 赞:
0 阅读:
804
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.
click to show follow up.
Follow up:
Did you use extra space?
A straight forward solution using O(mn) space is probably a bad idea.
A simple improvement uses O(m...
分类:
其他 时间:
2014-03-12 22:56:49
收藏:
0 评论:
0 赞:
0 阅读:
551
Ping pong
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 3427 Accepted Submission(s): 1264
Problem Description
N(3
Each play...
分类:
其他 时间:
2014-03-12 22:56:37
收藏:
0 评论:
0 赞:
0 阅读:
631
前面的文章分析了StandardEngine,这里来分析一下由Engine对象来管理的另外一种对象吧:Host。。
一般情况下,在tomcat中都是默认使用StandardHost类型。。。这里先来看看在catalina是如何配置创建StandardHost对象的吧:...
分类:
其他 时间:
2014-03-12 22:52:27
收藏:
0 评论:
0 赞:
0 阅读:
679
题目
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).
For example, this binary tree is symmetric:
1
/ 2 2
/ \ / 3 4 4 3
B...
分类:
其他 时间:
2014-03-12 22:04:15
收藏:
0 评论:
0 赞:
0 阅读:
560
哈夫曼编码实现...
分类:
其他 时间:
2014-03-12 22:45:37
收藏:
0 评论:
0 赞:
0 阅读:
398
封装:每个对象都包含它能进行操作所需要的所有信息,这个特性叫封装,因此对象不必依赖其他对象来完成自己的操作。
它有两重含义:第一,它把对象的属性和服务结合成一个独立的系统单位(即对象);第二,“信息隐蔽”,即尽可能隐蔽对象的内部细节,对外形成一个屏障或边界,只保留有限的对外接口使之与外部发生关系。
在面向对象的程序设计中,对象是一种自治、封装的实体。通过定义对象属性和行为的可见性,...
分类:
其他 时间:
2014-03-12 22:53:31
收藏:
0 评论:
0 赞:
0 阅读:
553
//从上往下打印二叉树(层序遍历,广度优先遍历)
#include
#include
using namespace std;
struct BinaryTreeNode
{
int m_nValue;
BinaryTreeNode* m_pLef;
BinaryTreeNode* m_pRight;
};
BinaryTreeNode* createBinaryTreeNode(int...
分类:
其他 时间:
2014-03-12 22:45:31
收藏:
0 评论:
0 赞:
0 阅读:
505
Splay入门题。。。断断续续写了几天。。。。
自己写的常数好大。。。。。
3224: Tyvj 1728 普通平衡树
Time Limit: 10 Sec Memory Limit: 128 MB
Submit: 862 Solved: 351
[Submit][Status]
Description
您需要写一种数据结构(可参考题目标题),来维护一些数,其中需要提...
分类:
其他 时间:
2014-03-12 22:52:35
收藏:
0 评论:
0 赞:
0 阅读:
412
和Hadoop1一样,YARN也支持可插入式的调度方式。本文将介绍如何在源码的基础上修改调度策略,并将其应用至Hadoop2上,以修改CapacityScheduler为例,原理和过程如下。...
分类:
其他 时间:
2014-03-12 21:41:44
收藏:
0 评论:
0 赞:
0 阅读:
504
这么一个场景:一个要承载高并发、具有高性能的后台服务,往往会有多个不同的应用服务。问题来了,你会怎样设计架构呢?
如下图所示,为了共用一个稳定高效的网络处理功能,把所有服务写在一个进程里。
接下来悲剧一幕幕就要上演了,如果各个模块是多人协作开发,网络库的作者得想办法设计个插件机制供各个应用挂载,开发时无论是人员或者代码都耦合非常严重,大大影响协作、开发效率,后期要增减一个应...
分类:
其他 时间:
2014-03-12 22:49:28
收藏:
0 评论:
0 赞:
0 阅读:
547
题目
Given n, how many structurally unique BST's (binary search trees) that store values 1...n?
For example,
Given n = 3, there are a total of 5 unique BST's.
1 3 3 2 ...
分类:
其他 时间:
2014-03-12 22:05:48
收藏:
0 评论:
0 赞:
0 阅读:
562
1)设置root密码: $sudo passwd root 先输入用户密码,然后设置root密码。
2》64位系统要使用32位的软件,需要安装一个库: $sudo apt-get install ia32-libs
3)编译安装Qt:以 qt-x11-opensource-src-4.3.2.tar.gz 为例
$ tar...
分类:
其他 时间:
2014-03-12 22:53:39
收藏:
0 评论:
0 赞:
0 阅读:
567
Stars
Time Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/65536 K (Java/Others)
Total Submission(s): 920 Accepted Submission(s): 400
Problem Description
Yifenfei is a romantic...
分类:
其他 时间:
2014-03-12 23:00:53
收藏:
0 评论:
0 赞:
0 阅读:
655
重点实现完成双向链表的操作:
#include
#include
#include
#define debug 0
typedef struct _tag_Name T_name, *PT_name;
struct _tag_Name {
char* name;
PT_name pre;
PT_name next;
};
static PT_name g_ptName_he...
分类:
其他 时间:
2014-03-12 22:59:57
收藏:
0 评论:
0 赞:
0 阅读:
626
图标中的文本如果太长就显示不全了。
查API ,
Label继承了TextBase,而 TextBase有maxDisplayedLines属性,表述如下:
确定是否截断文本以及在何处截断文本的整数。
截断文本意味着使用截断指示符(如 "...")替换超额文本。截断指示符与区域设置相关;它是由 "core" 资源包中的 "truncationIndicator" 资源指定的。
如...
分类:
其他 时间:
2014-03-12 22:50:12
收藏:
0 评论:
0 赞:
0 阅读:
556
Problems
#
Name
A
Vanya and Cards
standard input/output
1 s, 256 MB
x2537
B
Sereja and Contests
standard input/outpu...
分类:
其他 时间:
2014-03-12 21:53:43
收藏:
0 评论:
0 赞:
0 阅读:
457
相信大家对SlidingMenu都不陌生了,它是一种比较新的设置界面或配置界面的效果,在主界面左滑或者右滑出现设置界面效果,能方便的进行各种操作。很多优秀的应用都采用了这种界面方案,像facebook、人人网、everynote、Google+等等。如下图所示:
因为效果确实比较新颖,所以在很多的应用开...
分类:
其他 时间:
2014-03-12 22:54:50
收藏:
0 评论:
0 赞:
0 阅读:
668
【序言】惊奇的发现,矩阵乘法真是个优化程序的好东西。像矩阵乘法啊、堆啊,我会陆续学习。
【介绍】矩阵乘法:设A矩阵大小m*p,b矩阵大小为p*n,且C=A*B,那么C矩阵大小为m*n。C数组中的c[i][j]表示A矩阵的第i行和b矩阵的第j列两两相乘的和。矩阵具有结合律,但不具有交换律。
【例题*poj3070】
Fibonacci
Time Limit: 1000...
分类:
其他 时间:
2014-03-12 22:47:39
收藏:
0 评论:
0 赞:
0 阅读:
447