Skip to content
This repository was archived by the owner on Nov 26, 2019. It is now read-only.

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Linear Search

This program takes an array of size N and a number and checks if the number is present in the array.

Input Format

  • The input consists of three lines.
  • In the first line, there will be a single integer N.
  • In the second line, there will be N space separated integers.
  • In the third line, there will be a single integer, i.e., the number to be searched for in the array

Output Format

A single line containing the search result.

Sample Input

5
1 3 7 5 2
2

Sample Output

2 is present at index 4

Implemented in:

Python Implementation:

Input Format

The input consists of two lines-

  • First Line contains space separated integers which are array elements
  • In second line, there will be a single integer, i.e., the number to be searched in the array

Output Format

A single line containing the search result.

Sample Input

5
1 3 7 5 2
2

Sample Output

2 is present at index 4

Implemented in: