- 1、本文档共324页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
数据结构C算法.
目 录
1、顺序表 1
Seqlist.h 1
Test.cpp 6
2、单链表 8
ListNode.h 8
SingleList.h 10
test.cpp 20
3、双向链表 22
NodeList.h 22
DoubleList.h 24
Test.cpp 34
4、循环链表 36
ListNode.h 36
CircularList.h 37
Test.cpp 47
5、顺序栈 49
SeqStack.h 49
Test.cpp 54
6、链式栈 55
StackNode.h 55
LinkStack.h 56
Test.cpp 60
7、顺序队列 62
SeqQueue.h 63
Test.cpp 68
8、链式队列 70
QueueNode.h 70
LinkQueue.h 71
Test.cpp 75
9、优先级队列 77
QueueNode.h 77
Compare.h 78
PriorityQueue.h 80
Test.cpp 85
10、串 88
MyString.h 88
MyString.cpp 90
test.cpp 101
11、二叉树 104
BinTreeNode.h 104
BinaryTree.h 112
Test.cpp 124
12、线索二叉树 126
ThreadNode.h 126
ThreadTree.h 128
ThreadInorderIterator.h 128
test.cpp 139
13、堆 140
MinHeap.h 140
test.cpp 147
14、哈夫曼树 149
BinTreeNode.h 149
BinaryTree.h 151
MinHeap.h 156
Huffman.h 161
Test.cpp 163
15、树 164
QueueNode.h 164
LinkQueue.h 165
TreeNode.h 169
Tree.h 170
test.cpp 187
16、B+树 189
BTreeNode.h 189
BTree.h 192
test.cpp 215
17、图 217
MinHeap.h 217
Edge.h 222
Vertex.h 223
Graph.h 224
test.cpp 246
18、排序 249
Data.h 249
QueueNode.h 255
LinkQueue.h 259
Sort.h 263
test.cpp 278
1、顺序表
Seqlist.h
const int DefaultSize=100;
template typename Type class SeqList{
public:
SeqList(int sz=DefaultSize)
:m_nmaxsize(sz),m_ncurrentsize(-1){
if(sz0){
m_elements=new Type[m_nmaxsize];
}
}
~SeqList(){
delete[] m_elements;
}
int Length() const{ //get the length
return m_ncurrentsize+1;
}
int Find(Type x) const; //find the position of x
int IsElement(Type x) const; //is it in the list
int Insert(Type x,int i); //insert data
int Remove(Type x); //delete data
int IsEmpty(){
return m_ncurrentsize==-1;
}
int IsFull(){
return m_ncurrentsize==m_nmaxsize-1;
}
Type Get(int i){ //get the ith data
return i0||im_ncurrentsize?(coutcant find the elementendl,0):m_elements[i];
}
void Print();
private:
Type *m_elements;
const int m_nmaxsize;
int m_ncurrentsize;
};
template typename Type int SeqListType::Find(Type x) const{
for(int i=0;im_ncurrentsize;i++)
if(m_elements[i]==x)
return
您可能关注的文档
- 数学人教A版必修4第二章教案2.4.1《平面向量的数量级的物理背景及其含义》..doc
- 数学中考考点梳理..doc
- 数学中考知识点系统总结..doc
- 数学主干知识与方法回顾..doc
- 数学中考试题分类汇编(一次函数)..doc
- 数学中考知识点系统总结大全..doc
- 数学分析matlab实验报告..docx
- 数字逻辑电路与系统设计习题答案..doc
- 数学会考复习资料..doc
- 数学分析中的典型问题与方法 《勘误表》..doc
- 第17课 明朝的灭亡和清朝的建立 巩固练习 2024-2025学年下期初中历史统编版七年级下.docx
- 人教版(2019)必修三 Unit 1 Festivals and Celebrations Lis.pptx
- 人教版(2019)必修三 Unit 3 Diverse Cultures Reading for W.pptx
- 人教版(2019) 必修第一册 Unit 1 Teenage Life Reading and.pptx
- 人教版(2019)必修第一册Unit 2 Travelling Around Reading and.pptx
- 六年级单元作文复习.pptx
- 【作文写作法则】(初中语文)第10讲 常考应用文写作模板 学案.doc
- Unit 8 Once upon a Time 重点语法 专题练 2024-2025学.docx
- 人教版(2019)必修第一册Unit 3 Sports and fitness Reading fo.pptx
- 期末综合模拟试题 2024-2025学年下期初中道德与法治统编版八年级下册 (1).docx
文档评论(0)