function sort1(a,b){
var i=0,j=0,k=0;
var result=[]
while(i<a.length&&j<b.length){
if(a[i]<b[j]){
result[k++]=a[i++];
}
else{
result[k++]=b[j++];
}
}
while(i<a.length){
result[k++]=a[i++];
}
while(j<b.length){
result[k++]=b[j++]
}
return result
};複製代碼