Showing posts with label Binary Search. Show all posts
Showing posts with label Binary Search. Show all posts

How to write a simple and easy Binary search algorithm

Given a sorted array array[] of n elements and need to find the element 'val' present in the array or not by using Binary search technique. NOTE: Binary search works only on sorted array....