#include <stdio.h>
#include <stdlib.h>
struct node
{
int data;
struct node *next;
};
struct node *head, *tail, *p, *q, *r;
void SequenceCreate ()
{
head = ( struct node *) malloc ( sizeof ( struct node ));
head->next = NULL;
tail = head;
int n;
scanf("%d", &n);
while( n-- )
{
p = ( struct node *) malloc ( sizeof ( struct node ));
scanf("%d", &p->data);
tail->next = p;
tail = p;
}
}
void InvertedSCreate ()
{
head = ( struct node *) malloc ( sizeof ( struct node ));
head->next = NULL;
int n;
scanf("%d", &n);
while ( n-- )
{
p = ( struct node *) malloc ( sizeof ( struct node ));
scanf("%d", &p->data);
p->next = head->next;
head->next = p;
}
}
void Insert ( struct node *p, int key )
{
q = ( struct node * ) malloc ( sizeof( struct node ));
q->data = key;
q->next = NULL;
q->next = p->next;
p->next = q;
}
void del ( struct node *head, int key )
{
int flag = 0;
p = head;
while(p->next)
{
if(p->next->data == key)
{
q = p->next;
p->next = q->next;
free(q);
break;
}
else p = p->next;
}
}
void LinkListprint ( struct node *head )
{
p = head->next;
while(p->next)
{
printf("%d ", p->data);
p = p->next;
}
printf("%d\n", p->data);
}
int main()
{
return 0;
}