void insert_at_last(struct node **h, int num )
{
struct node *temp = NULL, *new_node = NULL;
temp = (*h);
if((*h) != NULL)
{
while(temp -> next != NULL)
{
temp = temp -> next;
}
new_node = create_node();
new_node -> info = num;
temp -> next = new_node;
new_node -> next = NULL;
}
else
{
printf("\nList is empty. Use insert at beginning option");
}
}
void insert_after(struct node **h, int num, int num1 )
{
int i = 0;
struct node *temp = NULL, *temp1 = NULL, *new_node = NULL;
temp = (*h);
while(temp -> next != NULL)
{
if(temp -> info == num)
{
temp1 = temp -> next;
break;
}
else
{
i = i + 1;
temp = temp -> next;
temp1 = temp -> next;
}
}
if((temp -> next == NULL)&& (temp -> info != num))
printf("\n Number is not present in the list.");
else
{
new_node = create_node();
new_node -> info = num1;
temp -> next = new_node;
new_node -> next = temp1;
}
}
int delete_after_i_node(struct node **h, int pos)
{
int i, deleted;
struct node *temp = NULL, *temp1 = NULL, *temp2 = NULL;
temp = (*h);
if((*h) != NULL)
{
temp = (*h);
temp1 = temp -> next;
temp2 = temp1 -> next;
for(i = 0; i < pos; i++)
{
if(temp1 -> next == NULL)
break;
temp = temp -> next;
temp1 = temp -> next;
temp2 = temp1 -> next;
}
if(i == pos)
{
temp -> next = temp2;
deleted = temp1 -> info;
free(temp1);
return deleted;
}
else
{
printf("\n Invalid position in the list.");
return NULL;
}
}
else
printf("\nList is empty.");
return NULL;
}
void delete_node(struct node **h, int num)