main.cpp:主程序
//Stack.h参见本分类下其它栈问题的描述
#include "../第三章 顺序栈的基本操作/Stack.h"
using namespace std;
int main()
{
int num,tmp=8;
Stack S;
InitStack(S);
cin>>num;
while(num!=0)
{
Push(S[......]
Tag Archives: 数据结构
《数据结构》括号匹配问题的实现
main.cpp:主程序
//Stack.h参见本分类其它栈问题的记录。
#include "../第三章 顺序栈的基本操作/Stack.h"
using namespace std;
int main()
{
Stack S;
InitStack(S);
int tmp;
char c;
while((c=getchar())!='\n')
{
&nbs[......]
严蔚敏《数据结构》栈的基本操作
Stack.h:定义了基本操作
#include "Stack.h"
using namespace std;
void print(int e)
{
cout<<e<<" ";
}
int main()
{
int i,tmp;
Stack S;
InitStack(S);
for(i=1;i<=5;i++)
if(Push[......]
迷宫问题,C++的栈实现
Stack.h:定义了栈的基础操作和数据类型
#include <iostream>
const int Stack_Size=9;
const int Stack_Incricement=2;
enum {OK=0,WRONG=-1};
typedef int Status;
typedef struct
{
int x;
int y;
}Pos;
typedef struct
{
Pos CurPos;
int[......]
读书笔记-《数据结构》第二章-线性表的顺序存储
读书笔记 《数据结构》严蔚敏,第二章的线性表(顺序存储),C++描述。
List.h
#include
#include
typedef int Status;
enum S{OK=0,WRONG=-1};
typedef struct
{
int *elem;
int len;
int listsize;
} List;
Status InitList(List &L)
{
if((L.elem=new i[......]