/*Time complexity: O(logn)
  Space complexity : O(1)
*/
class Solution {
    public int search(int[] nums, int target) {
        int l = 0;
        int r = nums.length;
        while (l < r) {
            int m = l + (r - l) / 2;
            if (nums[m] == target) {
                return m;
            } else if (nums[m] > target) {
                r = m;
            } else {
                l = m + 1;
            }
        }
        return -1;
    }
}

@@ -1,10 +1,38 @@
 /
-*
+/ Solution: Binary Search%0A// 
 Time com
@@ -48,17 +48,18 @@
 O(logn)%0A
- 
+//
  Space c
@@ -79,11 +79,8 @@
 (1)%0A
-*/%0A
 clas

add BinarySearch.java