binaryseacrh


Submit solution

Points: 10
Time limit: 2.0s
Memory limit: 12M

Author:
Problem type
Allowed languages
C

Write a C program for binary search. Input the first line number of elements in the array. second line the array elements in sorted order and third line the element to be searched. Output - if the element is present display the string found followed by the index of the element. if element not present display the string not found followed by -1

Input format

5

1 2 3 4 5

4

Output format

found 3


Comments