diff --git a/Binary search b/Binary search index 421f93b..00a8b16 100644 --- a/Binary search +++ b/Binary search @@ -1,3 +1,6 @@ +// What is binary search +// Binary search is an efficient algorithm for finding an item from a sorted list of items. It works by repeatedly dividing in half the portion of the list that could contain the // item, until you've narrowed down the possible locations to just one. + class BinarySearchExample{ public static void binarySearch(int arr[], int first, int last, int key){ int mid = (first + last)/2;