数据结构各种算法实现(C模板)

数据结构各种算法实现(C模板)

ID:47651775

大小:201.76 KB

页数:388页

时间:2019-10-16

数据结构各种算法实现(C模板)_第1页
数据结构各种算法实现(C模板)_第2页
数据结构各种算法实现(C模板)_第3页
数据结构各种算法实现(C模板)_第4页
数据结构各种算法实现(C模板)_第5页
资源描述:

《数据结构各种算法实现(C模板)》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库

1、1.顺序表1Seqlist・h1Test・cpp72.单链表9ListNode・h9SingleList・h11test・cpp223.双向链表25NodeList・h25DoubleList・h27Test・cpp384.循环链表40ListNode・h41CircularList・h42Test・cpp531.顺序栈56SeqStack・h56Test・cpp612.链式栈63StackNode・h63LinkStack・h64Test・cpp683.顺序队列71SeqQueue・h71Test・cp

2、p764.链式队列79QueueNode・h79LinkQueue・h80Test・cpp845.优先级队列87QueueNode・h87Compare・h88PriorityQueue・h90Test・cpp9610、串99MyString・h99MyString・cpp102test・cpp11411、二叉树117BinTreeNode・h117BinaryTree・h126Test・cpp14012、线索二叉树142ThreadNode・h143ThreadTree・h144Threadinorde

3、rIterator・h145test・cpp15713、堆158MinHeap.h159test・cpp16714.哈夫曼树168BinTreeNode・h168BinaryTree・h171MinHeap.h177Huffman・h182Test・cpp18415.树185QueueNode・h186LinkQueue・h187TreeNode・h191Tree・h192test・cpp21114.B+树214BTreeNode・h214BTree・h218test・cpp24324515.图MinHe

4、ap.h246Edge,h251Vertex・h252Graph・h254test・cpp27918、排序282Data,h282QueueNode・h289LinkQueue・h293Sort・h298test・cpp3141、顺序表Seqlist・hconstintDefaultSize=100;templateclassSeqList{public:SeqList(intsz=DefauItSize):m_nmaxsize(sz),m_ncurrentsize(-1){i

5、f(sz>0){m_elements=newType[m_nmaxsize];2008-9-3^SeqList(){delete[]m_elements;}intLength()const{returnm_ncurrentsize+l;}intFind(Typex)const;intIsElement(Typex)const;intInsert(Typex,inti);intRemove(Typex);intIsEmpty(){returnm_ncurrentsize==-l;//getthelength

6、//findthepositionofx//isitinthelist//insertdata//deletedata}intIsFull(){returnm_ncurrentsize==m_nmaxsize-l;}TypeGet(inti){//gettheithdatareturni<0

7、

8、i>m_ncurrentsize?(coutvtfindtheelement"<

9、axsize;intm_ncurrentsize;};templateintSeqList::Find(Typex)const{for(inti=0;iintSeqList::IsElement(Type

10、x)const{if(Find(x)==-1)return0;return1;templateintSeqList::Insert(Typex,inti){if(i<0

11、

12、i>m_ncurrentsize+l

13、

14、m_ncurrentsize==m_nmaxsize-l){cout<

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。