Posts

Showing posts from March, 2025

Dsa

C Code For Liked List and its Operations Using Arrays in Data Structure #include<stdio.h> #include <stdlib.h> struct Node{     int data;     struct Node *next; }; void Traversal(struct Node *ptr){     while(ptr != NULL){         printf("%d -> ",ptr->data);         ptr = ptr->next;     } } // insert at begining struct Node * insertAtFirst(struct Node *head,int data){     struct Node *ptr = (struct Node *)malloc(sizeof(struct Node));     ptr->next = head;     ptr->data = data;     return ptr; } // insert at end  struct Node * insertAtEnd(struct Node *head,int data){     struct Node *ptr = (struct Node *)malloc(sizeof(struct Node));     struct Node *p = head;     ptr->data = data;          while(p->next != NULL){         p = p->next;     }   ...