#include
#include
struct linknode
{
int data;
struct linknode *next;
};
void insert(struct linknode **head, int i)
{
struct linknode *p;
if(*head == NULL)
{
*head = (struct linknode *)malloc(sizeof(struct linknode));
(*head)->data = i;
(*head)->next = NULL;
}
else
{
p = (*head);
while(p->next)
p = p->next;
p->next = (struct linknode *)malloc(sizeof(struct linknode));
p->next->data = i;
p->next->next = NULL;
}
}
void removelink(struct linknode *head)
{
struct linknode *temp;
if(head == NULL)
return;
while(head)
{
temp = head;