#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define STACK_INIT_SIZE 100
#define STACKINCREMENT 10
typedef struct Ldone
{
int *leftbase;
int *lefttop;
int *rightbase;
int *righttop;
int stacksize;
}Ldon;
Ldon InisStack(Ldon S)
{
printf(" Welcome to enter The two-way Stack!");
getchar();
S.leftbase=(int *)malloc(STACK_INIT_SIZE * sizeof(int));
S.lefttop=S.leftbase;
S.stacksize=STACK_INIT_SIZE;
S.rightbase=S.leftbase+S.stacksize;
S.righttop=S.rightbase;
return S;
}
void Push(Ldon S)
{
int m;char ch;
printf("please enter the side(left/right):(L/R)");
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余2页未读,立即下载