Files
shifalearn/linkedlist.c
T
2026-07-29 11:35:17 +00:00

30 lines
362 B
C

#include<stdio.h>
#include<stdlib.h>
#include "linkedlist.h"
Node *head = NULL;
void insert(int data)
{
Node *newNode = malloc(sizeof(Node));
newNode->data = data;
newNode->next = head;
head = newNode;
}
void display()
{
Node *temp=head;
while(temp!=NULL)
{
printf("%d ",temp->data);
temp=temp->next;
}
}