#include <stdio.h>
#include<malloc.h>
typedef struct Node
{
int data;
struct Node *Next;
}Node,*LinkedList;
/*
下面的程序为尾差法建立单链表
*/
void tailCreat(LinkedList &L,int i)
{
int j;
LinkedList p1,p2;
L = (LinkedList)malloc(sizeof(Node));
p1=L;
for(j=1;j<=i;j++)
{
p2=(LinkedList)malloc(sizeof(Node));
p2->data=j;
p1->Next=
#include<malloc.h>
typedef struct Node
{
int data;
struct Node *Next;
}Node,*LinkedList;
/*
下面的程序为尾差法建立单链表
*/
void tailCreat(LinkedList &L,int i)
{
int j;
LinkedList p1,p2;
L = (LinkedList)malloc(sizeof(Node));
p1=L;
for(j=1;j<=i;j++)
{
p2=(LinkedList)malloc(sizeof(Node));
p2->data=j;
p1->Next=