0
4.5kviews
Write a C program to implement a singly linked list which supports the following operation:

a) Insert a node in the beginning

b) Insert a node in the end

c) Insert a node after a specific node

d) Deleting a specific node

e) Displaying the list

Mumbai University > COMPS > Sem 3 > Data Structures

Marks: 10 M

Year: May 2014, Dec 2014

1 Answer
0
205views
#include<stdio.h>
#include<conio.h>
struct node *insert_begin(struct node *start)
{
    struct node *new_node;
    int num;
    printf("\n enter the value");
    scanf("%d",&num);
    new_node=(struct node *)malloc(sizeof(struct node));
    new_node->data=num;
    new_node->next=start;
    start=new_node;
    return start;
}
struct node *insert_end(struct node *start)
{
    struct node *new_node,*ptr;
    ptr=start;
    int num;
    printf("\n enter the value");
    scanf("%d",&num);
    new_node=(struct node *)malloc(sizeof(struct node));
    new_node->data=num; …

Create a free account to keep reading this post.

and 3 others joined a min ago.

Please log in to add an answer.