Linear search in java

Previous
Next

In this post, we will see about linear search in java.

Linear search is simple sequential search in which target element is searched one by one in the array. If element is found in the array then index will be returned else -1 will be returned.
Here is simple program for linear search.

Output:

Element 43 found at index:3

That’s all about linear search in java.

Previous
Next

Join Our News Letter – Stay Updated

Subscribe to Awesome Java Content.




Add Comment

Join Our News Letter - Stay Updated

Subscribe to Awesome Java Content.
You can like our facebook page Java2blog