序列的类型定义为:
typedef struct {
ElemType *elem;
int length;
} Sequence;
Status CreateSequence(Sequence &S, int n, ElemType *a)
/* 由长度为n的一维数组a构建一个序列S,并返回OK。 */
/* 若构建失败,则返回ERROR */
{
int i;
if(n<=0)
序列的类型定义为:
typedef struct {
ElemType *elem;
int length;
} Sequence;
Status CreateSequence(Sequence &S, int n, ElemType *a)
/* 由长度为n的一维数组a构建一个序列S,并返回OK。 */
/* 若构建失败,则返回ERROR */
{
int i;
if(n<=0)