Write a function to find the maximum and minimum elements in an array.
Implement find_max_min(arr), which accepts a non-empty array of integers and returns a two-element tuple (maximum, minimum). Scan the array without sorting it. Account for negative values and duplicate elements.
Constraints: 1 <= len(arr) <= 10^4; each element is an integer between -10^9 and 10^9.
def find_max_min(arr):