Professional Documents
Culture Documents
Linked List
Linked List
h>
#include <stdlib.h>
struct node
{
int data;
struct node *next;
} *head;
void initialize()
{
head = NULL;
}
int main() {
initialize();
printf("\n Name : Ayushmaan Kapahi ");
printf("\nRoll Number : 1/20/FET/BCS/031");
printf("\n----------------------------------\n\n");
Front(4); // Inserting node at front
Front(3); // Inserting node at front
Front(2); // Inserting node at front
Front(1); // Inserting node at front
printf("\n\n Before insertion at the end of list :-");
printf("\n -------------------------------------\n");
printLinkedList(head);
End(head,5); // Inserting node at the end
printf("\n\n After insertion at the end of list :-");
printf("\n ------------------------------------\n");
printLinkedList(head);
return 0;
}