题目:
假定两个单链表是递增有序,定义并实现以下函数,完成两个单链表的合并,继续保持递增有序
int LL_merge(ListNode *La, ListNode *Lb)
#include<iostream>
using namespace std;
#define error 0
#define ok 1
class Node
{
public:
int data;
Node *next;
Node() {next=NULL;}
};
class List
{
public:
Node *head;
int len;
List()
{
head = new Node;
len=0;
}
~List()
{
Node *p,*q;
p=head;
while(p!=NULL)
{
q=p;
p=p->next;
delete []q;
}
len=0;
head = NULL;
}
void InitList(int n)
{
int x,i;
Node *tail;
tail = head;
for(i=0;i<n;i++)
{
cin>>x;
Node