Skip to content

Commit e0f9ece

Browse files
3ianc4kelvins
andauthored
Update src/c/BuscaSequencialRecursiva.c
Co-authored-by: Kelvin S. do Prado <kelvinpfw@gmail.com>
1 parent 0b40ef4 commit e0f9ece

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/c/BuscaSequencialRecursiva.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ int buscaSequencialRecursiva(int vetor[], int i, int buscado, int size) {
1212
}
1313
else
1414
{
15-
buscaSequencialRecursiva(vetor, i+1, buscado, size);
15+
return buscaSequencialRecursiva(vetor, i+1, buscado, size);
1616
}
1717
}
1818

@@ -22,4 +22,4 @@ int main(){
2222
size_t n = sizeof(vetor) / sizeof(vetor[0]);
2323
printf("Valor %d no índice %d\n", 1, buscaSequencialRecursiva(vetor, 0, 1, n));
2424
printf("Valor %d no índice %d\n", 10, buscaSequencialRecursiva(vetor, 0, 10, n));
25-
}
25+
}

0 commit comments

Comments
 (0)