//这是我在学数据库时写的C++的B树的实现.
B树有四个性质:
1.树中每个节点最多含有2m-1的节点;
2.除了根节点外,其他每个节点至少有m-1个孩子;
3.若根节点不是叶子节点则至少有2个孩子(即整个树只有根节点);
4.所有叶子节点都在同一层
#include
using namespace std;
static const int m = 3; //定义最小度为3
s...
分类:
编程语言 时间:
2016-04-24 11:16:04
阅读次数:
234
static和const联合使用: static将一个全局变量变成局部变量 const将一个局部变量变成局部常量 // 定义了一个局部常量 static const CGFloat ZMJRed = 0.4; 使用static const 与 #define: 使用static const修饰变量和 ...
分类:
移动开发 时间:
2016-04-07 20:18:17
阅读次数:
225
(1)auto 这个关键字用于声明变量的生存期为自动,即将不在任何类、结构、枚举、联合和函数中定义的变量视为全局变量,而在函数中定义的变量视为局部变量。这个关键字不怎么多写,因为所有的变量默认就是auto的。 (2)register 这个关键字命令编译器尽可能的将变量存在CPU内部寄存器中而不是通过 ...
分类:
编程语言 时间:
2016-04-06 13:02:19
阅读次数:
151
// processDIY.m #import "processDIY.h" static const CGFloat kBorderWidth = 2.0f; @interface THProgressLayer : CAReplicatorLayer @property (nonatomic, ...
分类:
移动开发 时间:
2016-03-31 12:22:12
阅读次数:
244
在实现文件(.m文件)中使用static const来定义“只在编译单元内可见的常量”(只在.m文件内可见),由于此类常量不在全局符号表中,所以无须为其名称加类名前缀(一般以k开头)。 在头文件中使用extern来声明全局常量,并在相关实现文件中定义其值,这种常量会出现在全局符号表中,所以其名称应以
分类:
其他好文 时间:
2016-03-04 19:21:33
阅读次数:
151
The version withconst char *will copy data from a read-only location to a variable on the stack.The version withstatic const char *references the data...
分类:
其他好文 时间:
2016-01-11 13:48:12
阅读次数:
185
static int row=0;static const NSString *kStoryboardName = @"LRCoreDataViewController";static const NSString *kIdentifier = @"LRCoreDataViewController"...
分类:
移动开发 时间:
2015-12-23 14:23:40
阅读次数:
216
因为项目用到Pch文件链接宏变量,因而稍作研究怎样使用,define宏变量其实并不合适 ,static const才最适合 Pch文件听说是上古世纪存在的文件,主要是用来全局预编译文件统一在一个出口,方便编程管理,但同时往往会造成预编译时间过长,但预编译只要设置恰当,其实并没有增加时间,还方便了开....
分类:
其他好文 时间:
2015-12-09 16:48:52
阅读次数:
180
void SkinRGB(IplImage* rgb, IplImage* _dst){ assert(rgb->nChannels == 3 && _dst->nChannels == 3); static const int R = 2; static const int G ...
分类:
其他好文 时间:
2015-12-04 20:46:00
阅读次数:
204
static member variable[可读可写] 可以通过指针间接修改变量的值static const member variable[只读] 压根就不可以修改变量的值,会报错
分类:
编程语言 时间:
2015-11-07 14:40:24
阅读次数:
357