1 /* c1
h (程序名) */ #inclu de #inclu de #inclu de /* malloc()等 */ #inclu de /* INT_MAX 等 */ #inclu de /* EOF(=^Z 或F6),NULL */ #inclu de /* atoi() */ #inclu de /* eof() */ #inclu de /* floor(),ceil(),abs() */ #inclu de /* ex it() */ /* 函数结果状态代码 */ #define TRUE 1 #define FALSE 0 #define OK 1 #define ERROR 0 #define INFEASIBLE -1 /* #define OVERFLOW -2 因为在math
h 中已定义 OVERFLOW 的值为3,故去掉此行 */ ty pedef int Statu s; /* Statu s 是函数的类型,其值是函数结果状态代码,如 OK 等 */ ty pedef int Boolean; /* Boolean 是布尔类型,其值是 TRUE 或FALSE */ 2 /* algo2-1
c 实现算法2
1 的程序 */ #include"c1
h" typedef int ElemType; #include"c2-1
h" /*c2-1
h 线性表的动态分配顺序存储结构 */ #define LIST_INIT_SIZE 10 /* 线性表存储空间的初始分配量 */ #define LISTINCREMENT 2 /* 线性表存储空间的分配增量 */ typedef struct { ElemType *elem; /* 存储空间基址 */ int length; /* 当前长度 */ int listsize; /* 当前分配的