![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构与算法
文章平均质量分 76
charlieling
这个作者很懒,什么都没留下…
展开
-
链表
************************* int原创 2014-08-06 09:44:43 · 198 阅读 · 0 评论 -
栈
************************* seqStack.cpp *************************#include #include template class SeqStack{public: SeqStack() { vec.reserve(size); //reserve:容器预留空间,无元素对象 } ~SeqStack() {原创 2014-08-06 21:37:30 · 131 阅读 · 0 评论 -
循环链表
************************* circleLinkList.h *************************#include template class CircleLinkNode{public: CircleLinkNode( const T& val) { value = val; next = NULL; } T value; C原创 2014-08-06 17:02:35 · 165 阅读 · 0 评论 -
队列
************************* seqQueue.cpp *************************#include template //设置最大容量class SeqQueue{public: SeqQueue() { first = last = 0; //初始时下标重叠 cursize = 0; } ~SeqQueue() {原创 2014-08-07 14:39:32 · 153 阅读 · 0 评论 -
字符串
size_t strlen( const char *str ){ size_t length = 0; char *p = str; //保持str指向串首不变 while( *p++ ) ++length; return length;}原创 2014-08-09 20:28:18 · 131 阅读 · 0 评论 -
堆
************************* heap.h *************************template class Heap{public: Heap( const int size ); ~Heap(); //最好声明为虚函数 bool isLeaf( int pos ); void insert( c原创 2014-08-11 15:35:28 · 144 阅读 · 0 评论 -
二叉树
************************* binaryTree.h *************************#include using namespace std;template class BinaryTree;template class Node{ friend class BinaryTree;public: Node( const T& e原创 2014-08-11 14:16:25 · 163 阅读 · 0 评论 -
图
void DFS( Graph &G, int v ){ visit( G, v ); G.Mark[v] = VISITED; //访问当前顶点 for( Edge e = G.FirstEdge(v); G.IsEdge(e); e = G.NextEdge(e) )//遍历当前节点的所有邻接顶点 { int to_v = G.ToVe原创 2014-08-12 19:41:23 · 212 阅读 · 0 评论