Posts

Showing posts from April, 2018

Implementing Linked Lists in C

/*this is a described program to implement Smple LL   ***inserting from the end and deleting from the begining & displaying***   */ #include <stdio.h> #include <stdlib.h> // ***defining the node*** struct node                           // creating data structure Node {     int data;                         // data type of the node-data     struct node *link;                 // pointer of the same node - points only to the defined data type }; struct node *START = NULL; /* before creating the 1 st node the */START pointer is null // ***creating a node*** struct node *createNode()             // returning type - struct node {     struct node *n;           n = (struct node*)malloc(sizeof(struct node));     // malloc finction is to allocating space for the creating node   // (data_type*)malloc(sizeof(data_type)); // allocating 2 variables of size 2          return (n);                                         // returning the memory address o