D

@DIVYA123

Linear search in c

C
5 years ago
#include<stdio.h> int linearSearch(int arr[], int size, int element){ for (int i = 0; i < size; i++) { if(arr[i]==element){ return i; } } return -1;

Binary search in data structure

C
5 years ago
#include<stdio.h> int binarySearch(int arr[], int size, int element){ int low, mid, high; low = 0; high = size-1; // Keep searching until low <= high while(low<=high){ mid = (low + high)/2; if(arr[mid] == element){ return mid;

radix sort in data structure

C
5 years ago
#include<stdio.h> int get_max (int a[], int n){ int max = a[0]; for (int i = 1; i < n; i++) if (a[i] > max) max = a[i]; return max; } void radix_sort (int a[], int n){ int bucket[10][10], bucket_cnt[10];

DEqueue in c

C
5 years ago
// Online C compiler to run C program online #include<stdio.h> #include<stdlib.h> struct circularQueue { int size; int f; int r; int* arr;

queue and its operations in c

C
5 years ago
#include<stdio.h> #include<stdlib.h> struct queue { int size; int f; int r; int* arr; };

heap sort in c

C
5 years ago
#include <stdio.h> void heap_sort(int [],int); void build_max_heap(int[],int); void max_heapify(int[],int,int); void main() { int i,r,hepsize,n; int a[50]; printf("Enter number of elements in array"); scanf("%d",&n);

Insertion sort in c

C
5 years ago
#include<stdio.h> void printArray(int* A, int n){ for (int i = 0; i < n; i++) { printf("%d ", A[i]); } printf("\n"); }

Bubble sort in c

C
5 years ago
#include<stdio.h> void printArray(int* A, int n){ for (int i = 0; i < n; i++) { printf("%d ", A[i]); } printf("\n"); } void bubbleSort(int *A, int n){

stack linked list

C
5 years ago
#include<stdio.h> #include<stdlib.h> struct Node{ int data; struct Node * next; }; void linkedListTraversal(struct Node *ptr)

stack

C
5 years ago
#include <stdio.h> #include <stdlib.h> int main() { int value,choice; while(1) { printf("1. Push \t 2. POP\t 3. Display\t 4. Exit\n"); printf("Enter your choice"); scanf("%d",&choice); switch (choice);

deleting elements

C
5 years ago
#include <stdio.h> #include <stdlib.h> struct Node { int data; struct Node *next; }; void linkedListTraversal(struct Node *ptr)

menu driven program in c linked list

C
5 years ago
#include<stdio.h> #include<stdlib.h> struct node { int data; struct node *next; }; struct node *head; void beginsert ();

traversal single linked list

C
5 years ago
// Singly linkedListTraversal program. #include <stdio.h> #include <stdlib.h> struct Node { int data; struct Node *next; };

symmetric of matrix

C
5 years ago
#include <stdio.h> int isSymmetric(int a[10][10],int,int); int count; int main() { int a[10][10],b[4][4],r,c,i,j; printf("enter numbers\n"); scanf("%d%d",&r,&c); if (r!=c) { printf("Symmetric is not possible\not");

function

C++
5 years ago
#include <iostream> //#include<math.h> using namespace std; int add(int,int); int sub(int,int); int main() { int a,b,c,d; cin>>a; cin>>b;

structure

C++
5 years ago
#include <iostream> using namespace std; struct res { int rn; char name[30]; int math; int hindi; int phy; } ;struct res a[5];

WELCOME

C++
5 years ago
#include <iostream> int main() { std::cout << "Hello world!" << std::endl; return 0; }