This file contains 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
// Busca Linear | |
#include <stdio.h> | |
#include <stdlib.h> | |
int buscaLinear(int *arr, int n, int valor) { | |
for (int i = 0; i < n; i++) { | |
if (arr[i] == valor) | |
return i; // Retorna o índice se o valor for encontrado | |
} |