数据结构作业答案大连理工大学
f数据结构作业2013
作业1线性表
编程作业:1.将顺序表逆置,要求用最少的附加空间。
参考答案i
cludestdiohi
cludemallochi
cludeprocessh
defi
eLIST_INIT_SIZE100defi
eLISTINCREMENT10
defi
edefi
edefi
edefi
edefi
edefi
e
TRUEFALSEOKERRORINFEASIBLEOVERFLOW
101012
f数据结构作业2013
typedefi
tStatustypedefi
tElemType
typedefstructElemTypeelem
i
tle
gthi
tlistsizeSqList
创建空顺序表StatusI
itList_SqSqListL
LelemElemTypemallocLIST_INIT_SIZEsizeofElemType
ifLelemexitOVERFLOW
Lle
gth0LlistsizeLIST_INIT_SIZEretur
OK
f数据结构作业2013
顺序表在第i个元素之前插入eStatussxbcrSqListLi
tiElemTypee
ElemTypepqifi1iLle
gth1
retur
ERRORelseqLelemi1
forpLelemLle
gth1pqpp1p
qeLle
gthretur
OK
f数据结构作业2013
顺序表显示voidxsListSqListL
i
tiLle
gthkfork0kik
pri
tf