input: Write a function to calculate the minimum and maximum values in an array. The function should return a tuple containing the minimum and maximum values of the array. If the array is empty, the function should return None.
  def min_max(array):
      if not array:
          return None
      min_val = array[0]
      max_val = array[0]
      for val in array[1:]:
          if val < min_val:
              min_val = val
          if val > max_val:
              max_val = val
      return min_val, max_val
  
  assert min_max([3, 5, 1, 2]) == (1, 5)
  assert min_max([7, 2, 8, 4]) == (2, 8)
  assert min_max([]) == None
  assert min_max([10]) == (10, 10)
  assert min_max([-5, -10, 0, 5]) == (-10, 5)
output: def min_max(array):
      if not array:
          return None
      min_val = array[0]
      max_val = array[0]
      for val in array[1:]:
          if val < min_val:
              min_val = val
          if val > max_val:
              max_val = val
      return min_val, max_val