数据结构课程实验实训报告--堆栈和队列的基本操作。
- 格式:doc
- 大小:224.00 KB
- 文档页数:13
《数据结构》课程实验实训报告
printf("\n");
Destroy(myStack);
printf("This program is made by10273206\n"); }
2.#include
#include
#define MaxStackSize 100
typedef int DataType;
typedef struct
{
DataType stack[MaxStackSize];;
int top;
} SeqStack; /*初始化操作:*/
void StackInitiate(SeqStack *S)
/*初始化带头结点链式堆栈*/
{
S->top=0;
}
int StackNotEmpty(SeqStack S)
{
if(S.top<=0)
3.#include "stdio.h"
#include "string.h"
#include "stdlib.h"
#define MaxQueueSize 100 typedef int DataType;
typedef struct
{
DataType queue[MaxQueueSize]; int rear ;
int front;
int count;
} SeqCQueue ;
void QueueuInitiate(SeqCQueue *Q) {
Q->rear=0;
Q->front=0;
Q->count=0;
}
int QueueNotEmpty(SeqCQueue Q) {
4.#include "stdio.h"
#include "string.h"
#include "stdlib.h"
#define MaxQueueSize 100 typedef int DataType;
typedef struct
{
DataType queue[MaxQueueSize]; int rear ;
int front;
int count;
} SeqCQueue ;
void QueueuInitiate(SeqCQueue *Q) {
Q->rear=0;
Q->front=0;
Q->count=0;
}
int QueueNotEmpty(SeqCQueue Q)
四、指导老师评语
指导老师签名: