数据结构(c++)
sdipper
这个作者很懒,什么都没留下…
展开
-
链队列的实现(c++)
// 环境:vs2010// 代码比较少,所以直接一个源文件#include <iostream>using namespace std;template <class DataType>struct Node //结点结构{ DataType data; Node<DataType>* next;};template &l...原创 2018-11-27 12:22:58 · 306 阅读 · 0 评论 -
循环队列的实现(c++)
//环境:vs2010//代码较少,直接一个源文件#include <iostream>using namespace std;const int QueueSize=100; template <class DataType> class CirQueue{ public: CirQueue(); //建立空队 ~CirQ...原创 2018-11-27 12:30:46 · 487 阅读 · 0 评论 -
中缀表达式求值(c++)
//环境:vs2010//expseqstack.h#ifndef EXPSEQSTACK_H //定义头文件#define EXPSEQSTACK_Hconst int StackSize=10; //10只是示例性的数据,可以根据实际问题具体定义typedef struct{ char op; int inputpreceden...原创 2018-11-27 12:46:08 · 3543 阅读 · 0 评论 -
顺序栈的应用-刮号匹配问题
//环境:vs2010//SeqStack.hconst int Maxsize=100;template <class T>class SeqStack{public: SeqStack();//空栈的建立 ~SeqStack(){}// bool Empty();//空栈判断 bool Full();//满栈判断 int Leng...原创 2018-11-27 22:38:38 · 198 阅读 · 0 评论 -
图的构造和实现——邻接矩阵[无向图](c++)
//环境:vs2010//MGraph.h#ifndef MGraph_H //定义头文件#define MGraph_Hconst int MaxSize = 10; //图中最多顶点个数template <class DataType>class MGraph{public: MGraph(...原创 2018-11-28 19:49:12 · 2583 阅读 · 0 评论 -
图的构造和实现——邻接表[有向图](c++)
//环境:vs2010//ALGraph.cpp#include <iostream>using namespace std;const int MaxSize=10; //图的最大顶点数struct ArcNode //定义边表结点{ int adjvex; //邻接点域 ArcNode *next;};template ...原创 2018-11-28 20:33:19 · 2685 阅读 · 0 评论