#include <stdio.h> #include <malloc.h> typedef struct Node {int date;
struct node *next;
}node,*lnode; void CreateList (Lnode &l,int N); Insert a positive sequence into the list behind the list void Createlist2 (Lnode &l,int N); At the front of the list is a constant insertion of node void display (Lnode l);
Display chain table void Display2 (Lnode l);
int main () {Lnode L;
CreateList (l,5);
Display (l);
printf ("\ n");
Display2 (L->next);
/* node l1,l2,l3;
Lnode p;
l1.date=1;
l1.next=&l2;
l2.date=2;
l2.next=&l3;
l3.date=3;
L3.next=null;
p=&l1;
for (P=l1;p->next!=null;p=p->next)//{printf ("%d", p->next->date);//} */return 0;
} void CreateList (Lnode &l,int n) {int i;
Lnode p,q;
L= (Lnode) malloc (sizeof (node));
l->next=null;
Q=l;
printf ("Enter data \ n");
for (i=0;i<n;i++) {p= (lnode) malloc (sizeof (node));
scanf ("%d", &p->date);
q->next=p;
q=q->next;
} q->next=null;
} void Createlist2 (Lnode &l,int n) {int i;
Lnode Q;
L= (Lnode) malloc (sizeof (node));
l->next=null; printf ("Loseinto data \ n ");
for (i=0;i<n;i++) {p= (lnode) malloc (sizeof (node));
scanf ("%d", &p->date);
p->next=l->next;
l->next=p;
} void Display (Lnode l) {Lnode p;
for (P=l->next;p!=null;p=p->next) {printf ("%d", p->date);
} void Display2 (Lnode l) {if (l==null) {return;
else {printf ("%d", l->date);
l=l->next;
Display2 (L->next); }
}