定义
二叉搜索树(Binary Search Tree)或称二叉查找树,也称二叉排序树(Binary Sort Tree)。它或者是一棵空树,或者是具有下列性质的二叉树:
若左子树不空,则左子树上所有节点的值均小于它的根节点的值;
若右子树不空,则右子树上所有节点的值均大于它的根节点的值;
左、右子树也分别为二叉搜索树;
性质
二叉搜索树与普通二叉树相比,有一些优秀的特征或性质:
由于节点是有序排放的:左子树<根节点<右子树。故在查找一个节点的时候,只需先和根节点比较,再决定是进入左子树还是右子树查找。...
分类:
其他 时间:
2014-07-06 11:06:16
收藏:
0 评论:
0 赞:
0 阅读:
325
继承Action,重写方法execute
execute方法
@param ActionMapping 封装了struts_config.xml中的Action配置信息
@param ActionForm 封装了struts_config.xml中的FormBean配置信息(接受前台页面的参数,将form强制转为对应的参数类)
继承ActionForm :定义参数和属性
配置配置文件
配置form——Bean的语法
{CSDN:CODE:418064}
配置Action实现类的配置实例
{...
分类:
其他 时间:
2014-07-06 00:12:53
收藏:
0 评论:
0 赞:
0 阅读:
554
执行启动nginx:/usr/local/nginx/sbin/nginx
错误:/usr/local/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
查找:[roo...
分类:
其他 时间:
2014-07-06 00:12:16
收藏:
0 评论:
0 赞:
0 阅读:
1011
,请谅解~
Nim or not Nim?
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 960 Accepted Submission(s): 466
Problem Description
...
分类:
其他 时间:
2014-07-06 11:14:49
收藏:
0 评论:
0 赞:
0 阅读:
407
直接贴代码啦
/**
*
* @param zkIp
* @param zkPort
* @param tablename
* @param startRow 传null扫全表
* @param stopRow 已~结尾
* @throws Exception
*/
public static void scanTable(String zkIp,Stri...
分类:
Windows开发 时间:
2014-07-06 09:04:24
收藏:
0 评论:
0 赞:
0 阅读:
483
1.print语句输出和交互式解释器输出的不同
在下面的例子中,我们把一个字符串赋值给变量myString,先用print 来显示变量的内容,
之后用变量名称来显示。
>>> myString = 'Hello World!'
>>> print myString
Hello World!
>>> myString
'Hello World!'
注意:在仅用变量名时,输出的字符串是...
分类:
编程语言 时间:
2014-07-06 09:03:41
收藏:
0 评论:
0 赞:
0 阅读:
388
今天来按照apidemos提供的方法来实现slow loading的效果.
Main.java
import android.app.ListActivity;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view...
分类:
Windows开发 时间:
2014-07-06 10:54:32
收藏:
0 评论:
0 赞:
0 阅读:
468
Structs2 Result学习笔记(一)简单介绍
问题一
/r1.jsp
/r2.jsp
r1
r2
dispatcher - forward运用服务器跳转...
分类:
Web开发 时间:
2014-07-06 10:53:48
收藏:
0 评论:
0 赞:
0 阅读:
445
最小生成树问题。
求最小生成树的最大边,没有坑点。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define INF 0x7fffffff
#define eps 1e-6
using namespace std;...
分类:
其他 时间:
2014-07-06 11:58:31
收藏:
0 评论:
0 赞:
0 阅读:
358
Result学习笔记(二) - 动态结果集
动态结果 一定不要忘了为动态结果的保存值设置set get方法
第一部分:代码
//前端
Insert title here
返回success
返回error
//web.xml
${r}
/...
分类:
Web开发 时间:
2014-07-06 09:29:01
收藏:
0 评论:
0 赞:
0 阅读:
340
ZOJ 3529 A Game Between Alice and Bob(博弈论-sg函数)
题目大意:
给定n个数字,两个人轮流玩游戏,把这n个数字变成n的因子(不包含本身),最后全变成1就赢了,问你谁会赢,如果Alice赢了,把第一步选择的那一个数字的序号输出,如果有多种方案,输出序号小的。
解题思路:
sg[1]=0;
sg[2]=mex{sg[1]}=1;
sg[3]=mex{sg[1]}=1;
sg[4]=mex{sg[2],sg[1]}=2;
sg[5]=mex{sg[1]}=1;
sg[...
分类:
其他 时间:
2014-07-06 09:28:16
收藏:
0 评论:
0 赞:
0 阅读:
331
Result学习笔记(三)带参数的结果集
第一部分:代码
//前端
Insert title here
传参数
//web.xml
/user_success.jsp?t=${type}
//类包
package com.struts2.user.act...
分类:
Web开发 时间:
2014-07-06 08:26:07
收藏:
0 评论:
0 赞:
0 阅读:
409
可以将列表和元组当成普通的“数组”,它能保存任意数量任意类型的Python 对象。和数
组一样,通过从0 开始的数字索引访问元素,但是列表和元组可以存储不同类型的对象。...
分类:
编程语言 时间:
2014-07-06 08:25:33
收藏:
0 评论:
0 赞:
0 阅读:
342
这次基本上没出大的错误。。根据按键向下的功能实现了一下向上的功能,还有旋转rotate()功能
myitem.h
#ifndef MYITEM_H
#define MYITEM_H
#include
class myItem : public QGraphicsItem
{
public:
myItem();
QRectF boundingRect() const;
...
分类:
其他 时间:
2014-07-06 09:02:59
收藏:
0 评论:
0 赞:
0 阅读:
571
Advanced Fruits
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 1944
Accepted: 967
Special Judge
Description
The company "21st Century Fruits" has spec...
分类:
其他 时间:
2014-07-06 10:22:47
收藏:
0 评论:
0 赞:
0 阅读:
605
跟我上一篇解题报告一样,都是找最小生成树的最大边。
依然Kruskal,每次比较找最大即可。
有人问我为啥一直CE,妥妥的不看题目,都说了可能有重复的边,存储边数组的开大一点就好了。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#i...
分类:
其他 时间:
2014-07-06 10:22:03
收藏:
0 评论:
0 赞:
0 阅读:
279
矩阵快速幂 HDU 1757...
分类:
其他 时间:
2014-07-06 09:15:59
收藏:
0 评论:
0 赞:
0 阅读:
314
做Java Web开发很容易遇到乱码问题,这个问题出现的原因不外乎两个:网络传输数据使用的编码与java编码不一致;java编码与数据库编码不一致。如果是第一个原因导致的乱码,问题相对较简单,并且修正之后通过热部署就可以解决问题;如果是第二个原因导致的问题,那么影响就比较严重,很有可能这些数据就永久丢失了。笔者最近在开发一个手游服务器时,就遇到了第二个原因导致的乱码问题,为了解决这个问题,当时费了很大的功夫深入研究了JDBC和MySQL的编码原理。想想,这个过程还是很耗时间和精力的,因此我决定把我的经历和理...
分类:
数据库技术 时间:
2014-07-06 08:24:54
收藏:
0 评论:
0 赞:
0 阅读:
406
问题:
scanf("%s", a);
运行输入hello world
回车
则输入到a的只是空格之前的部分,怎样把空格之后的部分也输出?
1. scanf( "%[^\n]", str );
#include
int main(){
char str[50];
scanf( "%[^\n]", str );
printf( "%s\...
分类:
编程语言 时间:
2014-07-06 11:05:31
收藏:
0 评论:
0 赞:
0 阅读:
574
按他的方法排序,每次移动一个数到顶点,排成需要的序列。
Problem D: ShellSort
He made each turtle stand on another one's back
And he piled them all up in a nine-turtle stack.
And then Yertle climbed up. He sat down on the p...
分类:
其他 时间:
2014-07-06 09:15:23
收藏:
0 评论:
0 赞:
0 阅读:
440