Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Single linked list #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions Single linked list
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
struct Link
struct node
{
int info;
struct Link *next;
struct node *next;
};
struct Link *head,*ptr,*node;
struct node *head,*ptr,*node;

//create
void create()
Expand All @@ -17,7 +17,7 @@ void create()
char ch;
do
{
node=(struct Link*)malloc(sizeof(struct Link));
node=(struct node*)malloc(sizeof(struct node));
if(node==NULL)
{
printf("no memory\n");
Expand Down Expand Up @@ -69,7 +69,7 @@ void count_node()
//insert begin
void insert_beg()
{
node=(struct Link*)malloc(sizeof(struct Link));
node=(struct node*)malloc(sizeof(struct node));
if(node==NULL)
{
printf("no memory\n");
Expand All @@ -85,7 +85,7 @@ void insert_beg()
//insert end
void insert_end()
{
node=(struct Link*)malloc(sizeof(struct Link));
node=(struct node*)malloc(sizeof(struct node));
if(node==NULL)
{
printf("no memory\n");
Expand Down Expand Up @@ -118,7 +118,7 @@ void delete_beg()
//delete end
void delete_end()
{
struct Link *temp;
struct node *temp;
ptr=head;
if(ptr==NULL)
{
Expand Down Expand Up @@ -206,7 +206,7 @@ void insert_position()
int i=1,pos;
printf("\nenter a position to insert- \n");
scanf("%d",&pos);
node=(struct Link*)malloc(sizeof(struct Link));
node=(struct node*)malloc(sizeof(struct node));
if(node==NULL)
{
printf("no memory\n");
Expand Down Expand Up @@ -239,7 +239,7 @@ void insert_position()
void delete_after_node()
{
int ser;
struct Link *temp;
struct node *temp;
printf("\nenter an element for search- \n");
scanf("%d",&ser);
ptr=head;
Expand All @@ -260,7 +260,7 @@ void delete_after_node()
//delete position
void delete_position()
{
struct Link *temp;
struct node *temp;
int i=1,pos;
printf("\nenter a position to delete- \n");
scanf("%d",&pos);
Expand Down