This project implements a simple linear search algorithm in C encapsulated within a helper function.
-
Function:
int Eleman_Index_Bul(int dizi[], int aranan) - Input: An integer array and a target value.
-
Process:
- Iterates through the array indices (
$0 \to N-1$ ). - Compares
dizi[i]witharanan.
- Iterates through the array indices (
-
Output:
- If found: Returns
i + 1(1-based Rank). - If not found: Returns
-1.
- If found: Returns
Based on Question 1:
Array: {1, 2, 5, 12, 20, 50, 4, 30}
Target: 5
-
Index 0:
1!=5 -
Index 1:
2!=5 -
Index 2:
5==5$\to$ Match! -
Result: Returns
2 + 1 = 3.
--- Dizi Arama Programi ---
Dizi: {1, 2, 5, 12, 20, 50, 4, 30}
Aranan Sayi: 5
Sonuc: Aranan eleman 3. sirada bulundu.