int sortL(SqList &L1,SqList &L2,SqList &L3){ int i=1,j=1,k=1; while(i<=L1.length&&j<=L2.length) { if(L1.elem[i-1]<=L2.elem[j-1]) { ListInsert_Sq(L3,++k,L1.elem[i-1]);i++; } else{ ListInsert_Sq(L3,++k,L2.elem[j-1]);j++; } } return 1; }
已知L1,L2为线性顺序表,合并起来为L3,这样写发现L3里面只有L1.length<L2.length? L1.length:L2.length 个,哪错了???
慕设计2395807
相关分类