Posts

Showing posts from August, 2024

DS - SLL

  Singly Linked List:   #include<stdio.h> #include<stdlib.h> void create(); void display(); void insert_at_begin(); void insert_at_end(); void insert_at_pos(); void delete_at_begin(); void delete_at_end(); void delete_at_pos(); void search(); void sort(); void count(); void reverse(); void merge(); int i,value,p; char ch; struct node { int data; struct node *next; }*new,*head,*temp,*d,*new1,*temp1; void main() { int n; printf("\n 1.create\n 2.display\n 3.insert-at-begin\n 4.insert-at-end\n 5.insert-at-pos\n 6.delete-at-begin\n 7.delete-at-end\n 8.delete-at-pos\n 9.search\n 10.sort\n 11.count\n 12.reverse\n 13.merge"); while(1) { printf("\n enter your choice:"); scanf("%d",&n); switch(n) { case 1: create(); break; case 2: display(); break; case 3: insert_at_begin(); break; case 4: insert_at_end(); break; case 5: insert_at_pos(); break; case 6: delete_at_begin(); brea...

DS - Module - II - DLL

  Implementation of Doubly Linked List #include<stdio.h> #include<stdlib.h> void create(); void display(); void insert_at_begin(); void insert_at_end(); void insert_at_pos(); void delete_at_begin(); void delete_at_end(); void delete_at_pos(); void reverse(); struct node {     int data;     struct node *prev,*next; }*new,*head,*temp,*d; int i,value,p; char ch; void main() {     int n;     printf("\n 1.create\n 2.display\n 3.insert_at_begin\n 4.insert_at_end\n 5.insert_at_pos\n 6.delete_at_begin\n 7.delete_at_end\n 8.delete_at_pos\n 9.reverse");   while(1) {     printf("enter your choice:");     scanf("%d",&n);     switch(n)     {           case 1:create();               ...