<gouthampradhan>binary_search_MinSortedRotatedArray_1.java
public int findMin(int[] nums) {
    if (nums.length == 0) return 0;
    else if (nums.length == 1) return nums[0];
    int low = 0, high = nums.length - 1;
    while (low < high) {
      int mid = (low + high) / 2;
      if (mid > 0 && nums[mid] < nums[mid - 1]) return nums[mid];
      if (nums[low] > nums[mid]) high = mid - 1;
      else if (nums[high] < nums[mid]) low = mid + 1;
      else high = mid - 1;
    }
    return nums[low];
  }
public int sample_funcname ( int [ ] var_0 ) {
  if ( var_0 . length == 0 ) return 0 ;
  else if ( var_0 . length == 1 ) return var_0 [ 0 ] ;
  int var_4 = 0 , var_5 = var_0 . length - 1 ;
  while ( var_4 < var_5 ) {
    int var_7 = ( var_4 + var_5 ) / 2 ;
    if ( var_7 > 0 && var_0 [ var_7 ] < var_0 [ var_7 - 1 ] ) return var_0 [ var_7 ] ;
    if ( var_0 [ var_4 ] > var_0 [ var_7 ] ) var_5 = var_7 - 1 ;
    else if ( var_0 [ var_5 ] < var_0 [ var_7 ] ) var_4 = var_7 + 1 ;
    else var_5 = var_7 - 1 ;
  }
  return var_0 [ var_4 ] ;
}
