Implentation of Linked List
Implentation of Linked List
insert_front();
break;
case 2:
case 3:
insert_end();
break;
insert_any();
break;
case 4:
}
display();
break;
getch();
}
//Function to insert a node at the front of a single linked list.
void insert_front()
{
int data_value;
printf("\nEnter data of the node: ");
scanf("%d", &data_value);
temp = (struct node *) malloc(sizeof(struct node));
temp->data = data_value;
temp->link = header->link;
header->link = temp;
temp->data = data_value;
temp->link = ptr->link;
ptr->link = temp;