first commit

This commit is contained in:
Zakaria
2025-12-02 04:47:09 -05:00
commit 3e1d017ff2
12 changed files with 88 additions and 0 deletions
@@ -0,0 +1,26 @@
/**
* SequentialSearchSortedarray
*/
public class SequentialSearchSortedarray {
public static void main(String[] args) {
int[] sortedArray = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
int index = SeqSearch(sortedArray, 53);
if (index != -1) {
System.out.println("Element found at index " + index);
} else {
System.out.println("Element not found");
}
}
public static int SeqSearch(int[] arr, int value) {
for (int i = 0; i < arr.length; i++) {
if (arr[i] == value) {
return i;
}
}
return -1;
}
}