Home > Back-end >  Due to the insert function problem sequence table
Due to the insert function problem sequence table

Time:11-02

Int SqInsert (SqList & amp; L, ElemType e) {
int i,j;
ElemType x;
Int len=L.l ength;
L.e lem [len + 1)=e;
for(i=1; ifor(j=i+1; jIf (L.e lem [I] & gt; L.e lem [j]) {
X=L.e lem [I];
L.e lem [I]=L.e lem [j];
L.e lem [j]=x;
}
}
}
return 1;
}
What a great god can give I well look for mistakes

CodePudding user response:

Array length is 1, the value is 0, the length is 2, the value is 0, 1, understand yao, the length is n, the subscript 0 - n - 1, your subscript is wrong, it ourselves,
  • Related