markandey007 / DSA_CODES

follow must before pr then i will check and merge ur pr
14 stars 84 forks source link

Create binary search #43

Closed Arsh000001 closed 2 years ago

Arsh000001 commented 2 years ago

In the above program, we declared an array arr[] = {5, 10, 15, 20, 25, 30, 35, 40); and then we specified number '25' to which search from the sorted array using the binary search method. Therefore, we create a user-defined function bin_search() that searches the given number and returns the statement "Element is found at position 5". If the number is not defined in the array, the bin_search() function shows " Element is not found in the array."