Blog – Latest Posts

Queue using linked list c program

#include #include struct node{ int info; struct node *link; }*front=NULL,*rear=NULL; void insert(int num); int del(); void display(); main() { int choice, num; while(1) { printf("\n1 Insert\n"); printf("2 Delete\n"); printf("3 Display\n");…

Queue using linked list

A queue has two ends front and the rear end. In a queue elements are added from the rear end and they are deleted from the front end of the…

C program implementing Stack using a Linked List

Previous method: https://marxtudor.com/stack-using-linked-list-c-program/ In this method pointer variable top is not declared in the global section its declared in the main() function. So we need to return the value of…

Stack using Linked List C program

Another approach to create the same program https://marxtudor.com/c-program-implementing-stack-using-a-linked-list/ Implementing stack using a linked list #include #include struct node { int info; struct node *link; }*top=NULL; void push(int num); int pop();…

Stack using linked list

When implementing stack using an array we make an array behave like a stack in the same way here we need to make a linked list behave like a stack…

Function to reverse a linked list

struct node *reverse(struct node *start) { struct node *previous, *ptr, *next; previous = NULL; ptr = start; while(ptr!=NULL) { next=ptr->link; ptr->link=previous; previous=ptr; ptr=next; } start=previous; return start; }

Linked list search function

void search(struct node *start, int num2) { struct node *p=start; int pos=1; while(p!=NULL) { if(p->info==num2) { printf("%d found at pos %d",num2); return; } p=p->link; } printf("num2 %d not found in…

Linked list C program

#include #include struct node{ int info; struct node *link; }; void display(struct node *start); struct node *addatbeg(struct node *start, int num); void addatend(struct node *start, int num); struct node *del(struct…

Linked List tutorial

A linked list is an abstract data type which contains elements of same data type arranged in sequential order. Just as an array is used to store elements in the…
alert('dsf'); console.log("dsdsdsd");