数据结构大题自用
作者:
Item
,
2022-08-02 09:57:39
,
所有人可见
,
阅读 141
typedef struct{
ElemType data[MaxSize];
int length;
}SqList;
bool del(SqList &L, ElemType &e){
if(L.length == 0) return false;
e = L[0];
int index = 0;
ElemType last = L[L.length - 1];
for(int i = 1; i < L.length; i ++){
if(L[i] < e){
e = L[i];
index = i;
}
}
L[index] = last;
L.length --;
return true;
}
void redata(SqList &L){
ElemType temp;
for(int i = 0; i < L.length / 2; i ++){
temp = L[i];
L[i] = L[L.length - i - 1];
L[L.length - i - 1] = temp;
}
}