input: Write a function to find the maximum element in a given array. The function should return the maximum value found in the array. If the given array is empty then return None.
  assert find_max_element([1, 10, 50, 3, 8])==50
  assert find_max_element([5, 15, 25, 10, 30])==30
  assert find_max_element([4, 8, 2, 6, 1])==8
  assert find_max_element([100])==100
  assert find_max_element([])==None
output: def find_max_element(arr):
      if not arr:
          return None
      max_val = arr[0]
      for num in arr:
          if num > max_val:
              max_val = num
      return max_val