码迷,mamicode.com
首页 >  
搜索关键字:maxsize    ( 995个结果
顺序队列C/C++实现
```#include using namespace std;const int MAXSIZE = 1000;typedef int ELEMTYPE;const int N = 10;typedef struct { ELEMTYPE data[MAXSIZE]; int head; int ... ...
分类:编程语言   时间:2016-05-13 12:10:30    阅读次数:136
循环队列的初始化、入队、出队等基本操作
循环队列的初始化、入队、出队等基本操作,实现代码如下:#include<iostream>usingnamespacestd;#defineTRUE1#defineFALSE0//循环队列的类型定义#defineMAXSIZE50//队列的最大长度typedefstruct{ intelement[MAXSIZE];//队列的元素空间 intfront;//头指针指示器 intrear;..
分类:其他好文   时间:2016-05-13 04:46:30    阅读次数:495
将非递减的A表和B表合并为C表,且C表也是非递减的
第一种:顺序表#include #include #define MAXSIZE 20typedef struct{ int data[MAXSIZE]; int len; }SqList;SqList * initSqList(){ SqList * L; L = (SqList *)malloc(sizeof(SqList...
分类:其他好文   时间:2016-05-12 21:35:29    阅读次数:175
数据结构之二叉树的各种运算
#include #include #define MaxSize 100 using namespace std; typedef struct node { char data; struct node *lchild; struct node *rchild; } BTNode; void CreateBTNode(BTNode *&b,char *str) { ...
分类:其他好文   时间:2016-05-12 21:18:15    阅读次数:232
数据结构_线性表_顺序存储之1顺序栈2共享栈_链式存储之链栈_栈的应用举例
1>//栈是先进后出,后进先出的线性表 简称LIFO线性表 //栈的顺序存储结构成为顺序栈(sequebtial stack). //顺序栈利用一组地址连的存储单元依次存放从栈底到 栈顶的数据元素,通常用一维数组存放栈的元素 //”指针”top并非指针,而是表示栈顶元素的当前位置 //top不是指针型变量而是整形变量,top=0空栈,top=MaxSize 表示满栈,当top>ma...
分类:其他好文   时间:2016-05-12 19:02:20    阅读次数:256
C++队列中应该注意的一些问题
第一次在C++中写类,新手,见笑 #include<iostream.h>#include<iostream>template<typename T> class Queue{private: int maxsize,front,rear; T *q;public: Queue() { q=new ...
分类:编程语言   时间:2016-05-11 17:53:37    阅读次数:125
并查集
以下是两种实现: // Model One const int MAXSIZE = 500010; int rank[MAXSIZE];      // 节点高度的上界 int parent[MAXSIZE];       // 根节点 int FindSet(int x){        // 查找+递归的路径压缩...
分类:其他好文   时间:2016-05-09 07:04:41    阅读次数:204
二叉平衡排序树的基本操作
//定义数据类型 #define MAXSIZE = 100; #define OK 1; #define ERROR 0; typedef int status; typedef int ElemType; //平衡二叉排序树的结构 typedef struct Tnode { ElemType ...
分类:编程语言   时间:2016-05-07 06:35:48    阅读次数:320
线性表
线性表存储 1.利用数组顺序存储 需要两个,一个是他存放的是什么,还有一个是指向最后一位的指针。 顺序表有动态分配和静态分配 静态分配: #define MaxSize 50 typedef struct { ElemType data[MaxSize]; int length; } 动态分配: # ...
分类:其他好文   时间:2016-05-03 23:28:20    阅读次数:138
【C语言】静态顺序表的实现(包括头插、头删、尾插、尾删、查找、删除指定位置)
#define_CRT_SECURE_NO_WARNINGS1 #include<iostream> usingnamespacestd; #include<assert.h> #defineMAXSIZE100 typedefintDataType; typedefstructSeqList { DataType_array[MAXSIZE]; size_t_size; }SeqList; voidInitSeqList(SeqList*pSeq) { assert(pS..
分类:编程语言   时间:2016-05-01 17:52:59    阅读次数:350
995条   上一页 1 ... 56 57 58 59 60 ... 100 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!