CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - c B
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Sub Category
Compress-Decompress algrithms
STL
Data structs
Algorithm
AI-NN-PR
matlab
Bio-Recognize
Crypt_Decrypt algrithms
mathematica
Maple
DataMining
Big Data
comsol
physical calculation
chemical calculation
simulation modeling
Search - c B - List
[
Data structs
]
数据结构的C++描述
DL : 0
目 录 译者序 前言 第一部分 预备知识 第1章 C++程序设计 1 1.1 引言 1 1.2 函数与参数 2 1.2.1 传值参数 2 1.2.2 模板函数 3 1.2.3 引用参数 3 1.2.4 常量引用参数 4 1.2.5 返回值 4 1.2.6 递归函数 5 1.3 动态存储分配 9 1.3.1 操作符new 9 1.3.2 一维数组 9 1.3.3 异常处理 10 1.3.4 操作符delete 10 1.3.5 二维数组 10 1.4 类 13 1.4.1 类Currency 13 1.4.2 使用不同的描述方法 18 1.4.3 操作符重载 20 1.4.4 引发异常 22 1.4.5 友元和保护类成员 23 1.4.6 增加#ifndef, #define和#endif语句 24 1.5 测试与调试 24 1.5.1 什么是测试 24 1.5.2 设计测试数据 26 1.5.3 调试 28 1.6 参考及推荐读物 29 第2章 程序性能 30 2.1 引言 30 2.2 空间复杂性 31 2.2.1 空间复杂性的组成 31 2.2.2 举例 35 2.3 时间复杂性 37 2.3.1 时间复杂性的组成 37 2.3.2 操作计数 37 2.3.3 执行步数 44 2.4 渐进符号(O、 健?、 o) 55 2.4.1 大写O符号 56 2.4.2 椒??58 2.4.3 符号 59 2.4.4 小写o符号 60 2.4.5 特性 60 2.4.6 复杂性分析举例 61 2.5 实际复杂性 66 2.6 性能测量 68 2.6.1 选择实例的大小 69 2.6.2 设计测试数据 69 2.6.3 进行实验 69 2.7 参考及推荐读物 74 第二部分 数据结构 第3章 数据描述 75 3.1 引言 75 3.2 线性表 76 3.3 公式化描述 77 3.3.1 基本概念 77 3.3.2 异常类NoMem 79 3.3.3 操作 79 3.3.4 评价 83 3.4 链表描述 86 3.4.1 类ChainNode 和Chain 86 3.4.2 操作 88 3.4.3 扩充类Chain 91 3.4.4 链表遍历器类 92 3.4.5 循环链表 93 3.4.6 与公式化描述方法的比较 94 3.4.7 双向链表 95 3.4.8 小结 96 3.5 间接寻址 99 3.5.1 基本概念 99 3.5.2 操作 100 3.6 模拟指针 102 3.6.1 SimSpace的操作 103 3.6.2 采用模拟指针的链表 106 3.7 描述方法的比较 110 3.8 应用 111 3.8.1 箱子排序 111 3.8.2 基数排序 116 3.8.3 等价类 117 3.8.4 凸包 122 3.9 参考及推荐读物 127 第4章 数组和矩阵 128 4.1 数组 128 4.1.1 抽象数据类型 128 4.1.2 C++数组 129 4.1.3 行主映射和列主映射 129 4.1.4 类Array1D 131 4.1.5 类Array2D 133 4.2 矩阵 137 4.2.1 定义和操作 137 4.2.2 类Matrix 138 4.3 特殊矩阵 141 4.3.1 定义和应用 141 4.3.2 对角矩阵 143 4.3.3 三对角矩阵 144 4.3.4 三角矩阵 145 4.3.5 对称矩阵 146 4.4 稀疏矩阵 149 4.4.1 基本概念 149 4.4.2 数组描述 149 4.4.3 链表描述 154 第5章 堆栈 161 5.1 抽象数据类型 161 5.2 派生类和继承 162 5.3 公式化描述 163 5.3.1 Stack的效率 164 5.3.2 自定义Stack 164 5.4 链表描述 166 5.5 应用 169 5.5.1 括号匹配 169 5.5.2 汉诺塔 170 5.5.3 火车车厢重排 172 5.5.4 开关盒布线 176 5.5.5 离线等价类问题 178 5.5.6 迷宫老鼠 180 5.6 参考及推荐读物 188 第6章 队列 189 6.1 抽象数据类型 189 6.2 公式化描述 190 6.3 链表描述 194 6.4 应用 197 6.4.1 火车车厢重排 197 6.4.2 电路布线 201 6.4.3 识别图元 204 6.4.4 工厂仿真 206 6.5 参考及推荐读物 217 第7章 跳表和散列 218 7.1 字典 218 7.2 线性表描述 219 7.3 跳表描述 222 7.3.1 理想情况 222 7.3.2 插入和删除 223 7.3.3 级的分配 224 7.3.4 类SkipNode 224 7.3.5 类SkipList 225 7.3.6 复杂性 229 7.4 散列表描述 229 7.4.1 理想散列 229 7.4.2 线性开型寻址散列 230 7.4.3 链表散列 234 7.5 应用——文本压缩 238 7.5.1 LZW压缩 239 7.5.2 LZW压缩的实现 239 7.5.3 LZW解压缩 243 7.5.4 LZW解压缩的实现 243 7.6 参考及推荐读物 247 第8章 二叉树和其他树 248 8.1 树 248 8.2 二叉树 251 8.3 二叉树的特性 252 8.4 二叉树描述 253 8.4.1 公式化描述 253 8.4.2 链表描述 254 8.5 二叉树常用操作 256 8.6 二叉树遍历 256 8.7 抽象数据类型BinaryTree 259 8.8 类BinaryTree 260 8.9 抽象数据类型及类的扩充 263 8.9.1 输出 263 8.9.2 删除 264 8.9.3 计算高度 264 8.9.4 统计节点数 265 8.10 应用 265 8.10.1 设置信号放大器 265 8.10.2 在线等价类 268 8.11 参考及推荐读物 275 第9章 优先队列 276 9.1 引言 276 9.2 线性表 277 9.3 堆 278 9.3.1 定义 278 9.3.2 最大堆的插入 279 9.3.3 最大堆的删除 279 9.3.4 最大堆的初始化 280 9.3.5 类MaxHeap 281 9.4 左高树 285 9.4.1 高度与宽度优先的最大及最小 左高树 285 9.4.2 最大HBLT的插入 287 9.4.3 最大HBLT的删除 287 9.4.4 合并两棵最大HBLT 287 9.4.5 初始化最大HBLT 289 9.4.6 类MaxHBLT 289 9.5 应用 293 9.5.1 堆排序 293 9.5.2 机器调度 294 9.5.3 霍夫曼编码 297 9.6 参考及推荐读物 302 第10章 竞??303 10.1 引言 303 10.2 抽象数据类型WinnerTree 306 10.3 类WinnerTree 307 10.3.1 定义 307 10.3.2 类定义 307 10.3.3 构造函数、析构函数及Winner 函数 308 10.3.4 初始化赢者树 308 10.3.5 重新组织比赛 310 10.4 输者树 311 10.5 应用 312 10.5.1 用最先匹配法求解箱子装载 问题 312 10.5.2 用相邻匹配法求解箱子装载 问题 316 第11章 搜索树 319 11.1 二叉搜索树 320 11.1.1 基本概念 320 11.1.2 抽象数据类型BSTree和 IndexedBSTree 321 11.1.3 类BSTree 322 11.1.4 搜索 322 11.1.5 插入 323 11.1.6 删除 324 11.1.7 类DBSTree 326 11.1.8 二叉搜索树的高度 327 11.2 AVL树 328 11.2.1 基本概念 328 11.2.2 AVL树的高度 328 11.2.3 AVL树的描述 329 11.2.4 AVL搜索树的搜索 329 11.2.5 AVL搜索树的插入 329 11.2.6 AVL搜索树的删除 332 11.3 红-黑树 334 11.3.1 基本概念 334 11.3.2 红-黑树的描述 336 11.3.3 红-黑树的搜索 336 11.3.4 红-黑树的插入 336 11.3.5 红-黑树的删除 339 11.3.6 实现细节的考虑及复杂性分析 343 11.4 B-树 344 11.4.1 索引顺序访问方法 344 11.4.2 m 叉搜索树 345 11.4.3 m 序B-树 346 11.4.4 B-树的高度 347 11.4.5 B-树的搜索 348 11.4.6 B-树的插入 348 11.4.7 B-树的删除 350 11.4.8 节点结构 353 11.5 应用 354 11.5.1 直方图 354 11.5.2 用最优匹配法求解箱子装载 问题 357 11.5.3 交叉分布 359 11.6 参考及推荐读物 363 第12章 图 365 12.1 基本概念 365 12.2 应用 366 12.3 特性 368 12.4 抽象数据类型Graph和Digraph 370 12.5 无向图和有向图的描述 371 12.5.1 邻接矩阵 371 12.5.2 邻接压缩表 373 12.5.3 邻接链表 374 12.6 网络描述 375 12.7 类定义 376 12.7.1 不同的类 376 12.7.2 邻接矩阵类 377 12.7.3 扩充Chain类 380 12.7.4 类LinkedBase 381 12.7.5 链接类 382 12.8 图的遍历 386 12.8.1 基本概念 386 12.8.2 邻接矩阵的遍历函数 387 12.8.3 邻接链表的遍历函数 388 12.9 语言特性 389 12.9.1 虚函数和多态性 389 12.9.2 纯虚函数和抽象类 391 12.9.3 虚基类 391 12.9.4 抽象类和抽象数据类型 393 12.10 图的搜索算法 394 12.10.1 宽度优先搜索 394 12.10.2 类Network 395 12.10.3 BFS的实现 395 12.10.4 BFS的复杂性分析 396 12.10.5 深度优先搜索 397 12.11 应用 399 12.11.1 寻找路径 399 12.11.2 连通图及其构件 400 12.11.3 生成树 402 第三部分 算法设计方法 第13章 贪婪算法 405 13.1 最优化问题 405 13.2 算法思想 406 13.3 应用 409 13.3.1 货箱装船 409 13.3.2 0/1背包问题 410 13.3.3 拓扑排序 412 13.3.4 二分覆盖 415 13.3.5 单源最短路径 421 13.3.6 最小耗费生成树 424 13.4 参考及推荐读物 433 第14章 分而治之算法 434 14.1 算法思想 434 14.2 应用 440 14.2.1 残缺棋盘 440 14.2.2 归并排序 443 14.2.3 快速排序 447 14.2.4 选择 452 14.2.5 距离最近的点对 454 14.3 解递归方程 462 14.4 复杂性的下限 463 14.4.1 最小最大问题的下限 464 14.4.2 排序算法的下限 465 第15章 动态规划 467 15.1 算法思想 467 15.2 应用 469 15.2.1 0/1背包问题 469 15.2.2 图像压缩 471 15.2.3 矩阵乘法链 476 15.2.4 最短路径 480 15.2.5 网络的无交叉子集 483 15.2.6 元件折叠 486 15.3 参考及推荐读物 491 第16章 回溯 492 16.1 算法思想 492 16.2 应用 496 16.2.1 货箱装船 496 16.2.2 0/1背包问题 503 16.2.3 最大完备子图 506 16.2.4 旅行商问题 508 16.2.5 电路板排列 510 第17章 分枝定界 516 17.1 算法思想 516 17.2 应用 519 17.2.1 货箱装船 519 17.2.2 0/1背包问题 526 17.2.3 最大完备子图 528 17.2.4 旅行商问题 529 17.2.5 电路板排列 532
Date
: 2009-10-17
Size
: 4.89mb
User
:
gufeng20081010
[
Data structs
]
btree-library
DL : 0
图书管理程序,b-tree,c++语言完成。程序非常的棒-library management procedures, b-tree, c complete language. Procedures for the wand! !
Date
: 2025-12-21
Size
: 18kb
User
:
good
[
Data structs
]
图书管理2to2
DL : 0
本系统完成了要求的所有功能,能进行图书的基本管理业务活动。包括采编入库、清除库存、借阅和归还等。利用B树对书号建立索引,提高了工作的效率。本系统支持对中文书籍的输入输出。.用户界面友好,有用户使用说明,每一步操作都有说明与提示。程序运行通过,有详细的解释说明。-the system completed all the required functions, the library will conduct basic management operations. Journalists, including depositing and removing stock, borrow and restitution. The use of B-tree index ISBN, improving work efficiency. The system supports Chinese books on the input and output. . User friendly interface, users note, every step of the operation have notes and hints. Running through a detailed explanation.
Date
: 2025-12-21
Size
: 13kb
User
:
妮娜
[
Data structs
]
数据结构和算法Flash动画演示
DL : 0
数据结构和算法Flash动画演示 B树的删除,B树的生长过程,串的顺序存储,单链表结点的插入,单链表结点的删除,堆排序,二叉排序树的删除等-data structures and algorithms Flash animation demo B-tree removal, B-tree growth, the sequence string storage, single linked list of nodes inserted, single linked list of nodes removed, heap sort, binary-tree removal, etc.
Date
: 2025-12-21
Size
: 943kb
User
:
仙道
[
Data structs
]
Libasdasd
DL : 0
b树的C++实现,运用模板实现B树 简单明了-C achieved, the use template simple B-tree
Date
: 2025-12-21
Size
: 10kb
User
:
冯
[
Data structs
]
复件 轮渡问题
DL : 0
1. 汽车轮渡口,过江渡船每次能载10辆车过江,过江车辆分为客车类和货车类,上渡船有如下规定:同类车先到先上船,客车先于货车上渡船,且每上4辆客车,才允许上一辆货车。若等待客车不足4辆,则从货车代替,若无货车等待允许客车上船。试写一个算法模拟渡口管理。 算法设计: 1客车和货车均建立一个链式队列,初始均为空。以后来一辆车不是货车就是客车,因此可以说整个程序的事件驱动event就是这两个,客车表示1,货车表示0. 2轮船还没有到达时客车和货车均按次序排在各自队列中。 3轮船到达时,根据两个队列的情况,分别处理。处理如下: a 客车数不满4辆,则将排在前面的货车上船,但总数不能超过10,若没有货车等待,客车直接上船。 b 客车数满4,但不满8辆,客车先上,排在前面的只有一辆货车可以上船,若没有货车等待则货车不上。 c 客车满8辆但不满10,客车上船,排在前面的货车最多可以上2辆,但总数不能超过10。 d 客车满10,则全上客车,但总数不能超过10。 -1. I car ferry, crossing the river each ferry can carry 10 cars crossing the river, crossing the river into passenger vehicles and goods category, Ferry on the following provisions : first vehicle in a first embarkation, the first passenger ferry in the truck and four on each passenger will be permitted on a lorry. If waiting for the bus less than four, then replace the truck, without waiting for the lorry to allow passenger embarkation. Try to write a simulated crossing management. Algorithm design : a bus and the truck were established a chain cohort, the initial were empty. Later, a car is not a passenger vehicle is, it can be said of the entire process event-driven event is the two, said a passenger, said the lorry 0. Two ships have not yet arrived at the bus and the truck were ranked
Date
: 2025-12-21
Size
: 2kb
User
:
西们子
[
Data structs
]
C语言开发 BTREE 数据文件索引程序库
DL : 0
用c开发的B+树索引结构,能实现B+树基本的查找,删除,搜索功能-with the development of B-tree index structures to achieve the basic B-tree search, delete, search functions
Date
: 2025-12-21
Size
: 15kb
User
:
皇者之剑
[
Data structs
]
排序算法、字典和B-树的C++语言实现
DL : 1
排序算法、字典和B-树的C++语言实现 代码内容 包括以下算法: qui.c sort: quicksort qsort.c sort: qsort ins.c sort: insert sort shl.c sort: shell sort has.c dictionary: hash tables bin.c dictionary: binary tree rbt.c dictionary: red-black trees skl.c dictionary: skip lists ext.c external sort btr.c btree 语言 C++ 编译平台 Visual C++ 作者 Thomas Niemann 备注 来自Sorting and Searching Algorithms:A Cookbook-algorithm, dictionaries and B-Tree C language code include the following algorithm : qui.c sort : quicksort qsort.c sort : qsort ins.c sort : insert sort shl.c sort : shell sort has.c dictionary : hash tables bin.c dictionary : binary tree rbt.c dictionary : red-black trees skl.c dictionary : skip lists ext.c external sort btr.c BTREE Part C language Visual C platform translated author Thomas Niemann Remarks from the Sorting and S earching Algorithms : A Cookbook
Date
: 2025-12-21
Size
: 24kb
User
:
罗鹏魁
[
Data structs
]
aaagchcv
DL : 0
源代码\用动态规划算法计算序列关系个数 用关系"<"和"="将3个数a,b,c依次序排列时,有13种不同的序列关系: a=b=c,a=b<c,a<b=v,a<b<c,a<c<b a=c<b,b<a=c,b<a<c,b<c<a,b=c<a c<a=b,c<a<b,c<b<a 若要将n个数依序列,设计一个动态规划算法,计算出有多少种不同的序列关系, 要求算法只占用O(n),只耗时O(n*n).-source \ use dynamic programming algorithm sequence relationship with the number "
Date
: 2025-12-21
Size
: 156kb
User
:
Sana
[
Data structs
]
LCS_Dynamic_Programming
DL : 0
LCS(最长公共子序列)问题可以简单地描述如下: 一个给定序列的子序列是在该序列中删去若干元素后得到的序列。给定两个序列X和Y,当另一序列Z既是X的子序列又是Y的子序列时,称Z是序列X和Y的公共子序列。例如,若X={A,B,C,B,D,B,A},Y={B,D,C,A,B,A},则序列{B,C,A}是X和Y的一个公共子序列,但它不是X和Y的一个最长公共子序列。序列{B,C,B,A}也是X和Y的一个公共子序列,它的长度为4,而且它是X和Y的一个最长公共子序列,因为X和Y没有长度大于4的公共子序列。 最长公共子序列问题就是给定两个序列X={x1,x2,...xm}和Y={y1,y2,...yn},找出X和Y的一个最长公共子序列。对于这个问题比较容易想到的算法是穷举,对X的所有子序列,检查它是否也是Y的子序列,从而确定它是否为X和Y的公共子序列,并且在检查过程中记录最长的公共子序列。X的所有子序列都检查过后即可求出X和Y的最长公共子序列。X的每个子序列相应于下标集{1,2,...,m}的一个子集。因此,共有2^m个不同子序列,从而穷举搜索法需要指数时间。 -LCS (longest public sequences) can be simply described as follows : given a sequence of sequences in the sequence is deleted after some element of the sequence. Given two sequences X and Y, Z is another sequence of the X-Y sequence is the sequences, Z is said X and Y series of public sequences. For example, if X = (A, B, C, B, D, B, A), (Y = B, D, C, A, B, A), the sequence (B, C, A) X and Y is a public sequences, it is not X and Y in a public longest sequences. Sequence (B, C, B, A) X and Y is a public sequences, and its length is 4. but it is the X and Y for a public longest sequence, X and Y because no greater than the length of the four sequences in public. The longest public sequences problem is given two sequences X = (x1, x2, ...) xm and Y = (y1, y2, ... yn), to identify X and Y in a
Date
: 2025-12-21
Size
: 4kb
User
:
汤烈
[
Data structs
]
btree
DL : 0
用c++写的用于ic设计中布图布线的工具源码,采用btree结构,包含文档-using c++ to write for ic design layout source routing tools used btree structure, including documentation
Date
: 2025-12-21
Size
: 442kb
User
:
qihuolin
[
Data structs
]
tree
DL : 0
严版数据结构。二叉树。功能齐全。经过调试。没有b+b_ 树。(c语言)。-Strict version of data structure. Binary tree. Full-featured. After debugging. No b+ B_ tree. (C language).
Date
: 2025-12-21
Size
: 225kb
User
:
caixu
[
Data structs
]
tree
DL : 0
c语言编写的B+树,可实现树的构造和记录查找。-c language B+ tree, the tree structure can be achieved and records to find.
Date
: 2025-12-21
Size
: 178kb
User
:
Y.A.M
[
Data structs
]
Text
DL : 0
编程题(15_01.c) 结构 struct student { long num char name[20] int score struct student *next } 链表练习: (1).编写函数struct student * creat(int n),创建一个按学号升序排列的新链表,每个链表中的结点中 的学号、成绩由键盘输入,一共n个节点。 (2).编写函数void print(struct student *head),输出链表,格式每行一个结点,包括学号,姓名,分数。 (3).编写函数struct student * merge(struct student *a,struct student *b), 将已知的a,b两个链表 按学号升序合并,若学号相同则保留成绩高的结点。 (4).编写函数struct student * del(struct student *a,struct student *b),从a链表中删除b链表中有 相同学号的那些结点。 (5).编写main函数,调用函数creat建立2个链表a,b,用print输出俩个链表;调用函数merge升序合并2个 链表,并输出结果;调用函数del实现a-b,并输出结果。 a: 20304,xxxx,75, 20311,yyyy,89 20303,zzzz,62 20307,aaaa,87 20320,bbbb,79 b: 20302,dddd,65 20301,cccc,99 20311,yyyy,87 20323,kkkk,88 20307,aaaa,92 20322,pppp,83-err
Date
: 2025-12-21
Size
: 1kb
User
:
[
Data structs
]
C++Primer
DL : 0
被《程序员》等机构评选为2006年最受读者喜爱的十大IT图书之一。 本书是久负盛名的C++经典教程,其内容是C++大师Stanley B. Lippman丰富的实践经验和C++标准委员会原负责人Josée Lajoie对C++标准深入理解的完美结合,已经帮助全球无数程序员学会了C++。本版对前一版进行了彻底的修订,内容经过了重新组织,更加入了C++ 先驱Barbara E.Moo在C++教学方面的真知灼见。既显著改善了可读性,又充分体现了C++语言的最新进展和当前的业界最佳实践。书中不但新增大量教学辅助内容,用于强调重要的知识点,提醒常见的错误,推荐优秀的编程实践,给出使用提示,还包含大量来自实战的示例和习题。
Date
: 2025-12-21
Size
: 25.38mb
User
:
张金水
[
Data structs
]
huffman
DL : 0
实现最优二叉树的构造;在此基础上完成哈夫曼编码器与译码器。 假设报文中只会出现如下表所示的字符: 字符 A B C D E F G H I J K L M N 频度 186 64 13 22 32 103 21 15 47 57 1 5 32 20 57 字符 O P Q R S T U V W X Y Z , . 频度 63 15 1 48 51 80 23 8 18 1 16 1 6 2 要求完成的系统应具备如下的功能: 1.初始化。从终端(文件)读入字符集的数据信息,。建立哈夫曼树。 2.编码:利用已建好的哈夫曼树对明文文件进行编码,并存入目标文件(哈夫曼码文件)。 3.译码:利用已建好的哈夫曼树对目标文件(哈夫曼码文件)进行编码,并存入指定的明文文件。 4.输出哈夫曼编码文件:输出每一个字符的哈夫曼编码。
Date
: 2025-12-21
Size
: 129kb
User
:
张娟
[
Data structs
]
b
DL : 0
用c++写的回文判断 用两 个栈实现的 一个用于辅助-With c++ Written judgments palindrome with two stacks used to realize an auxiliary
Date
: 2025-12-21
Size
: 1kb
User
:
wangwei
[
Data structs
]
b+
DL : 0
我们程序设计课上要求写的b+树的c++实现,可以进行插入查找删除等操作,代码简单,适合新手-We design classes require written b+ Tree c++ Achieve, can be inserted to find the deletion of such operations, the code is simple, suitable for novice
Date
: 2025-12-21
Size
: 2kb
User
:
刘仪伟
[
Data structs
]
B-Tree
DL : 0
B 树的各种操作 严蔚敏 数据结构 用c++ 实现的-B tree Yan Wei Min various operational data structures c++ implementation
Date
: 2025-12-21
Size
: 864kb
User
:
流水有声
[
Data structs
]
B-Tree
DL : 0
用c++实现的b-tree数据结构,小程序~(a b-tree program with c++)
Date
: 2025-12-21
Size
: 2kb
User
:
cx21312
«
1
2
3
4
5
6
7
8
9
10
»
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.