Skip to content

Commit fc1f085

Browse files
completed
1 parent c9670e5 commit fc1f085

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package SearchingAlgorithm;
2+
3+
public class LinearSearch {
4+
5+
static String linearSearch(int a[],int n,int t){
6+
for(int i=0;i<n;i++)
7+
if(a[i]==t)
8+
return "Founded";
9+
return "NotFounded";
10+
}
11+
public static void main(String[] args) {
12+
int a[]={11,3,55,6,7,355,77};
13+
int target=15;
14+
int n=a.length;
15+
System.out.println(linearSearch(a,n,target));
16+
}
17+
}

0 commit comments

Comments
 (0)