List Merge(List L1,List L2){
List r,S;
S = (List)malloc(sizeof(struct Node));
S->Next = NULL;
r = S;
List M = L1->Next;
List N= L2->Next;
while(M&&N){
if(M->Data <= N->Data)
{
r->Next=M;
r = M;
M = M->Next;
}
else
{
r->Next = N;
r = N;
N = N->Next;
}
}
for(;M;M=M->Next){
r->Next=M;
r = M;
}
for(;N;N=N->Next){
r->Next=N;
r = N;
}
L1->Next = NULL;
L2 ->Next = NULL; //注意给出的代码中有三个print函数,后面两个是输出NULL的
r->Next = NULL;
return S;
}