一棵AVL树是其每个节点的左子树和右子树的高度最多差1的二叉查找树。实际高度只比logN多以一点,和普通二叉查找树相比,平衡二叉搜索树一般而言搜寻时间可节省25%左右(STL源码剖析P203)。
只有那些从插入点到根节点的路径上的节点的平衡可能被改变,因为只有这些节点的子树可能发生变化。
把需要重新平衡的节点称为a(左右子树高度差大于1)。注意,确定这个节点很重要,否则无法确定...
分类:
其他好文 时间:
2014-05-10 09:57:21
阅读次数:
406
G++ 2.91.57,cygnus\cygwin-b20\include\g++\stl_stack.h 完整列表
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its do...
分类:
其他好文 时间:
2014-05-07 07:40:07
阅读次数:
322
G++ 2.91.57,cygnus\cygwin-b20\include\g++\stl_queue.h 完整列表
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its document...
分类:
其他好文 时间:
2014-05-06 22:22:55
阅读次数:
402
ffmpeg/ffplay是当今多媒体领域的王者,很多很多的人想研究学习ffmpeg/ffplay,但苦于ffmpeg/ffplay庞大的代码量,令人望而生畏。为帮助更多的人研习ffmpeg/ffplay,在保持ffmpeg/ffplay体系架构的完整性的前提下,把ffmpeg/ffplay大规模的...
分类:
其他好文 时间:
2014-05-01 01:23:05
阅读次数:
336
最近在看读《STL源码剖析》,看到Traits编程技法这节时,不禁感慨STL源码作者的创新能力。那么什么是Traits编程技法呢?且听我娓娓道来:
我们知道容器的许多操作都是通过迭代器展开的。其中容器类似于数组,迭代器类似于指针。我们用数组来写个例子:1 int arr[5] = {1,2,3...
分类:
其他好文 时间:
2014-04-29 18:15:15
阅读次数:
463
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
...
分类:
其他好文 时间:
2014-04-29 13:28:21
阅读次数:
398
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
...
分类:
其他好文 时间:
2014-04-29 13:13:21
阅读次数:
309
本文从三方面总结迭代器 迭代器的思想 迭代器相应型别及traits思想
__type_traits思想一 迭代器思想
迭代器的主要思想源于迭代器模式,其定义如下:提供一种方法,使之能够依序巡防某个聚合物(容器)所含的元素,而又无需暴露该聚合物的内部表达式。可见她的主要作用便是能够降低耦合,提高代码....
分类:
其他好文 时间:
2014-04-29 09:13:47
阅读次数:
378