Binary Search in C using Recursion
#include<stdio.h> void bins ( int lb , int ub , int item , int a []); void main () { int i , n , item , a [ 20 ]; printf ( &quo…
#include<stdio.h> void bins ( int lb , int ub , int item , int a []); void main () { int i , n , item , a [ 20 ]; printf ( &quo…
Program: #include<stdio.h> #include<conio.h> #define inf 999 void main () { int i , j , k , n , w [ 20 ][ 20 ]; clrscr (); printf ( …
Write a C program to implement Insertion Sort Algorithm Algorithm: for (c = 1 to n - 1) { d <= c; while ( d > 0 AND array[d] < a…
Write a C Program to Implement Prim’s Algorithm and find the Minimum Spanning Tree (MST) for the following Graph. Algorithm: visit[1] <- 1; while(…
Algorithm: hs( a[], n) { heap(a,n); for (i = n to 1) { temp<-a[1]; a[1]<-a[i]; a[i]<-temp; downheap(a,1,i-1); } …
#include <stdio.h> #define newnode (struct node*)malloc(sizeof(struct node)) typedef struct node { int data ; struct node * next ; } no…
Algorithm: ssort(array[],n) { for ( i = 0 to n-1 ) { position <- i; for ( j = …
#include<stdio.h> void main() { int arr[10],i,max,min,mid,val,index; printf("Please enter 10 values in ascending order:\n"); for(i…
Algorithm: dj(int n,int v,int cost[][],int dist[]) { for( i <- 1 to n ) flag[i]<-0; dist[i]<-cost[v][i]; count<-2; while(count&l…