input: Write a function to determine the mean and median of a given array. If the given array is empty, return None for both mean and median.
  
  assert mean_median([10, 15, 20, 25, 30, 35])==(22.5, 22.5)
  assert mean_median([1])==(1, 1)
  assert mean_median([1, 2])==(1.5, 1.5)
  assert mean_median([])==None
  assert mean_median([3, 5, 4, 1, 2])==(3, 3)
output: def mean_median(arr):
      if not arr:
          return None
      arr.sort()
      mean = sum(arr) / len(arr)
      n = len(arr)
      if n % 2 == 0:
          median = (arr[n//2 - 1] + arr[n//2]) / 2
      else:
          median = arr[n//2]
      return mean, median