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[......]
读书笔记--《数据结构 C语言版》第一章
读书笔记 《数据结构》严蔚敏,第一章的三元组实现,C++描述。
Triplet.h
#include
typedef int *Triplet;
typedef int Status;
enum value{WRONG=-2,OK,TRUE=10,FALSE=11};
Status InitTriplet(Triplet &T,int e1,int e2,int e3)
{
if((T=new int[3])==NULL)
return WR[......]
整数划分 递归
#include <iostream>
char *result=(char *)malloc(sizeof(char)*200);
int fun(int n,int m);
int main()
{
std::cout< return 0;
}
int fun(int n,int m)
{
if(n<0||m<0) return 0;
if(n==1||m==1) return 1;
 [......]