This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<stdlib.h> | |
//Returns the maximum of two integers | |
int max(int a,int b){ | |
if(a > b) | |
return a; | |
else | |
return b; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<stdlib.h> | |
//Each item has a weight, value and a value/weight ratio. | |
struct item{ | |
float weight; | |
float value; | |
float ratio; | |
}item[9],temp; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<stdlib.h> | |
#include<limits.h> | |
int matrixChainMul(int arr[],int n){ | |
int m[n][n]; | |
int i,j,L,k,q; | |
for(i=1;i<n;i++) | |
m[i][i] = 0; |