0
1.3kviews
Write a C program to implement singly linked list that performs following function 1. Insert a node in the beginning 2. Delete a specified node 3. Search for a specific value 4. Displaying the list
1 Answer
0
57views


Program : -

//C program for implementation of Linked List
#include<stdio.h>
#include<stdlib.h>

struct node{
    int data;
    struct node *next;
};

struct node *head = NULL;
struct node *tail = NULL;

void insertAtHead(int data){
    struct node *newNode = (struct node*)malloc(sizeof(struct node));
    newNode->data = data;
    newNode->next = head;

    if (head == NULL){ …

Create a free account to keep reading this post.

and 5 others joined a min ago.

Please log in to add an answer.