小说网 找小说 无限小说 烟雨红尘 幻想小说 酷文学 深夜书屋
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 102 下一页

2014年9月14日

冒泡排序

摘要: 今天,我们一起用C++写一个冒泡排序,目的就是通过不断地实践来熟练C++,具体代码如下:Data.h具体内容:template class Element{public: Type GetKey(){ return key; } void SetKey(Type item){ key ... 阅读全文

posted @ 2014-09-14 17:22 牛栏山1 阅读(114) 评论(0) 推荐(0) 编辑

希尔排序

摘要: 今天,我们一起用C++实现希尔排序,具体的代码如下:Data.h内容如下:template class Element{public: Type GetKey(){ return key; } void SetKey(Type item){ key = item; }public: E... 阅读全文

posted @ 2014-09-14 17:12 牛栏山1 阅读(156) 评论(0) 推荐(0) 编辑

二分插入排序

摘要: 今天,我们一起用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 牛栏山1 阅读(78) 评论(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 牛栏山1 阅读(60) 评论(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 牛栏山1 阅读(52) 评论(0) 推荐(0) 编辑

双链表

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

posted @ 2014-09-14 16:24 牛栏山1 阅读(83) 评论(0) 推荐(0) 编辑

顺序表

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

posted @ 2014-09-14 16:17 牛栏山1 阅读(123) 评论(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 牛栏山1 阅读(89) 评论(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 牛栏山1 阅读(92) 评论(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 牛栏山1 阅读(72) 评论(0) 推荐(0) 编辑

上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 102 下一页

导航