title: Sorting an unsorted array using only max(i,j) and a reverse(j) function
body: <p>I have just recently gotten myself into basic algorithms (trying to mostly experiment with python) and I was wondering whether it would be possible to sort an array from the lowest to highest value using only max(i,j) and a reverse(i) function. I have already written the reverse function by myself and I am stuck on how I could possibly incorporate it into solving the problem.
  Here's what I have come up with so far:</p>
  <pre><code>list = [4,2,5,3,1]
  
  def reverse(array, index):
      n = array
      first = 0
      while first &lt; index:
          if(index &lt;= 0 or index &gt; len(array)):
              return n
          else:
              holder = n[first]
              n[first] = n[index]
              n[index] = holder
              first += 1
              index -= 1
      return n
  
  print(reverse(list, 3))
  </code></pre>
  <p>Any tips or tricks would be greatly appreciated! Thank you in advance.
  EDITED: Changed to a function that actually works</p>