上一页 1 ··· 47 48 49 50 51 52 53 54 55 ··· 216 下一页

2014年9月14日

二分插入排序

摘要: 今天,我们一起用C++实现二分插入排序,具体如下。Data.h具体内容:template class Element{public: Type GetKey(){ return key; } void SetKey(Type item){ key = item; }public: El... 阅读全文

posted @ 2014-09-14 17:02 三少爷的剑123 阅读(107) 评论(0) 推荐(0)

插入排序

摘要: 今天,我们一起来实现插入排序,具体如下:Data.h内容:template class Element{public: Type GetKey(){ return key; } void SetKey(Type item){ key = item; }public: Element& ... 阅读全文

posted @ 2014-09-14 16:54 三少爷的剑123 阅读(101) 评论(0) 推荐(0)

摘要: 今天,我们一起用C++写一颗树,目的是熟练C++的语法细节,具体如下:LinkQueue.h内容如下:#include "QueueNode.h"template class LinkQueue{public: LinkQueue() :m_prear(NULL), m_pfront(NU... 阅读全文

posted @ 2014-09-14 16:34 三少爷的剑123 阅读(142) 评论(0) 推荐(0)

双链表

摘要: 今天,我们一起用C++写一个双链表,具体代码如下:DoubleList.h具体内容如下:#include "NodeList.h"template class DoublyList{public: DoublyList() :head(new ListNode()){ //the h... 阅读全文

posted @ 2014-09-14 16:24 三少爷的剑123 阅读(119) 评论(0) 推荐(0)

顺序表

摘要: 为了加深大家对C++的理解,我们还是继续通过实践的方式,今天,我们一起写一个顺序表,具体代码如下。Seqlist.h具体内容如下:const int DefaultSize = 100;template class SeqList{public: SeqList(int sz = De... 阅读全文

posted @ 2014-09-14 16:17 三少爷的剑123 阅读(148) 评论(0) 推荐(0)

顺序队列

摘要: 今天,我们一起实现一个顺序队列,通过它来熟练一下C++编程。SeqQueue.h具体内容如下:template class SeqQueue{public: SeqQueue(int sz) :m_nrear(0), m_nfront(0), m_ncount(0), m_nMaxSize... 阅读全文

posted @ 2014-09-14 16:03 三少爷的剑123 阅读(112) 评论(0) 推荐(0)

顺序栈

摘要: 今天,我们一起用C++写一个顺序栈,具体如下:SeqStack.h具体内容如下:template class SeqStack{public: SeqStack(int sz) :m_ntop(-1), m_nMaxSize(sz){ m_pelements = new Type[sz]... 阅读全文

posted @ 2014-09-14 15:58 三少爷的剑123 阅读(133) 评论(0) 推荐(0)

摘要: 今天,我们一起来实践一下数据结构-图,具体实现代码如下:Edge.h具体内容如下:template struct Edge{public: Edge(int dest, DistType cost) : m_ndest(dest), m_cost(cost), m_pnext(NULL){... 阅读全文

posted @ 2014-09-14 15:52 三少爷的剑123 阅读(119) 评论(0) 推荐(0)

线索二叉树

摘要: 今天,我们一起用C++实现一颗线索二叉树,具体代码如下:ThreadInorderIterator.h具体内容如下:#include "ThreadTree.h"template class ThreadInorderIterator{public: ThreadInorderIterat... 阅读全文

posted @ 2014-09-14 15:44 三少爷的剑123 阅读(110) 评论(0) 推荐(0)

优先级队列

摘要: 今天,我们的任务是实现一个优先级队列。具体实现如下:Compare.h具体内容如下:#include using namespace std;template class Compare{ //处理一般比较大小public: static bool lt(Type item1, Type ... 阅读全文

posted @ 2014-09-14 15:30 三少爷的剑123 阅读(107) 评论(0) 推荐(0)

上一页 1 ··· 47 48 49 50 51 52 53 54 55 ··· 216 下一页

导航