Posts

Showing posts from September, 2017

C++ Program to Solve Knapsack Problem by krbutani

C++ Program to Solve Knapsack Problem by krbutani #include<stdio.h> #include<conio.h> float m,p[100],w[100],r[100]; void main() {                 clrscr();                 int n;                 void swap(int,int);                 float cal(int);                 printf("\n\t Enter Capacity of Bag : ");                 scanf("%f",&m);                 printf("\n\t Enter How Many Item Deatils : ");       ...

Kruskal's Algorithm

Kruskal's Algorithm #include <iostream.h> #include <conio.h> #include <stdio.h> enum logical {TRUE=1,FALSE=0} ; struct edge {                 int from,to ;                 float cost ;                 int tree_no ; };                 int nv,ne,k=0 ;                 struct edge e[20] ; void greedy_kruskal(); logical feasible(int pos); void main() {                 clrscr();                 int i ;      ...

Job Seek Algorithm using C++

Job Seek Algorithm using c++ #include< stdio.h > #include< alloc.h > #include< process.h > #include< conio.h > struct job {                 int d,pro ;                 struct job *pre,*next; }; typedef struct job node; node *head,* jobc ; int f[100],front=0,rear=0; void main() {                  clrscr ( );                 int n;                 void insert( int,int );                 void display();                 v...