顺序存储线性表问题,如何将代码补充完整

问题遇到的现象和发生背景

将该段代码补充完整(如有错需修改)
并用上述基本方法,实现如下要求:
1)从键盘依次读入 10 个字符并保存在长度为 10 的字符数组中;
2)将数组第 6 个存储位置的字符删除;
3)在数组第 4 个存储位置之前插入一个字符 # ;
4)将数组中的所有字符打印输出;
使用上述顺序存储线性表的存储结构定义,实现一个一个时间复杂度为
O(n)、空间复杂度为 O(1)的算法,该算法可删除线性表中所有值为 e
的数据元素。自行定义函数名称、参数和返回值,并在 main 函数中加入
对这个函数的调用来将函数调试正确。

问题相关代码,请勿粘贴截图

#include <stdio.h>
#include <stdlib.h>
#define MAXSIZE 10 //最大长度
typedef char ElemType;
typedef struct {
ElemType* elem; //指向顺序存储的线性表的基地址
unsigned int uListLength; //线性表的当前长度
unsigned int uListSize; //线性表的最大长度

}SqList;
//线性表采用顺序存储实现,基本操作函数声明如下:
bool InitList(SqList& L, unsigned int uListSize);
bool DestroyList(SqList& L);
int ListLength(SqList L);
bool GetElem(SqList L, int i, ElemType &e);
bool ListInsert(SqList &L, int nPos, ElemType e);
bool ListDelete(SqList &L, int nPos, ElemType &e);
int main()
{

}

bool InitList(SqList& L, unsigned int uListSize)
{
L.elem = new ElemType[uListSize];
L.uListLength = 0;
L.uListSize = uListSize;
return true;
}

bool DestroyList(SqList& L)
{
delete[] L.elem;
L.elem = nullptr;
L.uListLength = 0;
L.uListSize = 0;
return true;
}
int ListLength(SqList L)
{
return (L. uLength);
}
int GetElem(SqList L,int i,ElemType &e)
{
if (i<1 || i>L.uLength) return 0;
e=L.elem[i-1];
return 1;
}
int LocateELem(SqList L,ElemType e)
{
for (i=0; i< L.uLength; i++)
if (L.elem[i]==e)
return i+1;
return 0;
}
bool ListDelete_Sq(SqList &L, int i)
{
if((i<1)||(i>L.uLength))
return false;
for (j=i;j<=L.uLength-1;j++)
   L.elem[j-1]=L.elem[j];
--L.uLength;
return true;
}

修改补充如下,供参考:

#include <stdio.h>
#include <stdlib.h>
#define MAXSIZE 10 //最大长度
typedef char ElemType;
typedef struct {
    ElemType* elem; //指向顺序存储的线性表的基地址
    unsigned int uListLength; //线性表的当前长度
    unsigned int uListSize; //线性表的最大长度
}SqList;
//线性表采用顺序存储实现,基本操作函数声明如下:
bool InitList(SqList& L, unsigned int uListSize);
bool InputList(SqList& L, ElemType e);
bool DestroyList(SqList& L);
int  ListLength(SqList L);
bool GetElem(SqList L, int i, ElemType &e);
bool ListInsert(SqList &L, int nPos, ElemType e);
bool ListDelete(SqList &L, int nPos);
void ListPrint(SqList L);
int main()
{
    SqList L;  int i;
    InitList(L,MAXSIZE);
    for (i = 0;i < MAXSIZE; i++)//读入10个字符并保存在长度为10的顺序表中
         InputList(L,i+'a');
    ListPrint(L);     //表中的所有字符打印输出

    ListDelete(L, 6); //将第6个存储位置的字符删除;

    ListInsert(L, 4, '#');//第 4 个存储位置之前插入一个字符 #

    ListPrint(L); //表中的所有字符打印输出
   
    return 0;
}
bool InitList(SqList& L, unsigned int uListSize)
{
    L.elem = new ElemType[uListSize];
    L.uListLength = 0;
    L.uListSize = uListSize;
    return true;
}
bool InputList(SqList& L, ElemType e)
{
    int i;
    if (L.uListLength >= L.uListSize)
        return 0;
    L.elem[L.uListLength] = e;
    L.uListLength++;
    return 1;
}
bool DestroyList(SqList& L)
{
    delete[] L.elem;
    L.elem = NULL;
    L.uListLength = 0;
    L.uListSize = 0;
    return true;
}
int ListLength(SqList L)
{
    return (L.uListLength);
}
bool GetElem(SqList L,int i,ElemType &e)
{
    if (i<1 || i>L.uListLength) return 0;
    e=L.elem[i-1];
    return 1;
}
int LocateELem(SqList L,ElemType e)
{
    int i;
    for (i=0; i< L.uListLength; i++)
        if (L.elem[i]==e)
            return i+1;
    return 0;
}
bool ListDelete(SqList &L, int nPos)
{
    int i;
    if((nPos < 1)||(nPos > L.uListLength))
       return false;
    for (i=nPos;i <= L.uListLength-1;i++)
         L.elem[i-1]=L.elem[i];
    --L.uListLength;
    return true;
}
bool ListInsert(SqList &L, int nPos, ElemType e)
{
    int i;
    if((nPos < 1)||(nPos > L.uListLength))
        return false;
    for(i = L.uListLength;i > nPos - 1;i--)
        L.elem[i] = L.elem[i - 1];
    L.elem[nPos-1] = e;
    L.uListLength++;
    return true;
}
void ListPrint(SqList L)
{
    int i;
    for (i = 0;i < L.uListLength;i++)
         printf("%c ",L.elem[i]);
    printf("\n");
}