# Peaks and Valleys

# In an array of integers, a "peak" is an element which is greater than or equal to
    # the adjacent integers and a "valley" is an element which is less than or equal
    # to the adjacent integers.

# For example, in the array [], [8, 6] are peaks and [5, 2] are valleys.  
# Given an array of integers, sort the array into an alternating sequence of 
    # peaks and valleys.

# EXAMPLE:  Input:  [5, 3, 1, 2, 3]   |   Output:  [5, 1, 3, 2, 3]

# time complexity:  O()
# space complexity:  O()

e65e42e3c4aab39b90a3b53811d5ce20437d3fd0
# Peaks and Valleys

# In an array of integers, a "peak" is an element which is greater than or equal to
    # the adjacent integers and a "valley" is an element which is less than or equal
    # to the adjacent integers.

# For example, in the array [], [8, 6] are peaks and [5, 2] are valleys.  
# Given an array of integers, sort the array into an alternating sequence of 
    # peaks and valleys.

# EXAMPLE:  Input:  [5, 3, 1, 2, 3]   |   Output:  [5, 1, 3, 2, 3]

# time complexity:  O()
# space complexity:  O()
