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[......]
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++描述。
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;
 [......]
计算日期差多少天
#include
#define yes 1
#define no 0
typedef struct date
{
int year;
int month;
int day;
}DATE;
long timedef(DATE d1,DATE d2);
int leap(int year);
int main()
{
DATE date1,date2;
date1.year=2006[......]