1.頭文件的聲明
#pragma once
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
2.順序表接口實(shí)現(xiàn)
typedef int SLDataType;//類型重命名
typedef struct SeqList
{
? ? SLDataType* a;
? ? int size; ? ? ? ?// 存儲(chǔ)有效數(shù)據(jù)個(gè)數(shù)
? ? int capacity; ? ?// 空間容量大小
}SL;
3.管理數(shù)據(jù)功能函數(shù)的聲明——初始化、銷毀、打印、擴(kuò)容
void SLInit(SL* ps);
void SLDestroy(SL* ps);
void SLPrint(SL* ps);
void SLCheckCapacity(SL* ps);
4.尾插尾刪、頭插頭刪函數(shù)的聲明
void SLPushBack(SL* ps, SLDataType x); ?//頭插
void SLPopBack(SL* ps); ? ? ? ? ? ? ? ? //頭刪
void SLPushFront(SL* ps, SLDataType x); //尾插
void SLPopFront(SL* ps); ? ? ? ? ? ? ? ?//尾刪
5.定位功能函數(shù)的聲明
// 在pos位置插入x
void SLInsert(SL* ps, int pos, SLDataType x);
// 刪除pos位置的值
void SLErase(SL* ps, int pos);