Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- double minValue(double arr[], int from, int to){
- if (from==to){
- return arr[from];
- }
- int m=(from+to)/2;
- if (minValue(arr, from, m)<minValue(arr, m+1, to)){
- return minValue(arr, from, m);
- } else {
- return minValue(arr, m+1, to);
- }
- }
- int main(){
- double x[]={5.0, 2.0, 6.0, 9.0, -5.0, 0.0};
- printf("%f", minValue(x, 0, 5));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment