Skip to content

Commit 6f31443

Browse files
committed
fixed formatting
1 parent c987963 commit 6f31443

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/java/LinearSearchIterative.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
public class LinearSearchIterative{
1+
public class LinearSearchIterative {
22
public static void main(String[] args) {
3-
int array_1[] = {1,2,40,233,78,83,456};
3+
int array_1[] = { 1, 2, 40, 233, 78, 83, 456 };
44
System.out.println(LinearSearch(array_1, 40));
55
System.out.println(LinearSearch(array_1, 3));
66
}
7-
public static int LinearSearch(int array[], int value){
8-
for(int i = 0 ; i < array.length ; i ++){
9-
if(array[i] == value){
7+
8+
public static int LinearSearch(int array[], int value) {
9+
for (int i = 0; i < array.length; i++) {
10+
if (array[i] == value) {
1011
return i;
1112
}
1213
}

0 commit comments

Comments
 (0)