循环队列的基本操作

#include <stdio.h> #include <stdlib.h> #include <time.h> #define OK 1 #define ERROR 0 #define TRUE 1 #define FALSE 0 #define MAXSIZE 20 /* 存储空间初始分配量 */ typedef int Status; /* QElemType类型根据实际情况而定,这里假设为int */ typedef int QElemType; /* 循环队列的顺序存储结构 */ typedef struct { QElemT...
代码 | 2013-01-02 16:05 | 阅读 798 次 | 评论 0 条

顺序队列的出栈与入栈

#include<iostream> #include<stdlib.h> #include<malloc.h> #define STACK_INIT_SIZE 100 #define STACKINCREMENT 10 using namespace std; struct sqstack { int *base; int *top; int stacksize; }; int Initstack(sqstack &amp;s) { s.base = (int*)malloc(STACK_INIT_SIZE*sizeof(int));...
默认分类 | 2013-01-02 16:04 | 阅读 818 次 | 评论 0 条
文章分类
文章归档
最新评论