文章
5
粉丝
0
获赞
0
访问
3.4k
#include<stdio.h>
#include<stdlib.h>
typedef struct node{
int date;
struct node *next;
}*LinkList,Lnode;
LinkList creat(int a[], int n){
int i;
Lnode *p;
LinkList head = (LinkList)malloc(sizeof(Lnode));
head->next = NULL;
for(i=n-1;i>=0;i--){
p = (Lnode*)malloc(sizeof(Lnode));
p->date = a[i];
p->next = head->next;
head->next = p;
}
return head;
}
//和归并排序merge思想类似的
LinkList merge(LinkList L1, LinkList L2){
LinkList L,p;
L = (LinkList)malloc(sizeof(Lnode));
L->next = NULL;
p=L;
L1 = L1->next;
&nbs...
登录后发布评论
暂无评论,来抢沙发