Algoritmo recursivo
Publicado por Recursividad (2 intervenciones) el 10/10/2016 20:51:56
ayuda con este algoritmo recursivo ¿que hace?
Gracias de antemano
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
int algoritmoRecursivo (int *vector , int base , int tope)
{
int aux1 , aux2;
if (base==tope) /* Caso Base */
return (vector[base]);
else{ /* Caso General */
aux1 = algoritmoRecursivo (vector , base , (base+tope) /2 );
aux2 = algoritmoRecursivo (vector , ((base+tope)/2)+1, tope);
if (aux1 > aux2)
return (aux1);
else
return (aux2);
}
}
Gracias de antemano
Valora esta pregunta


0