Skip to content

Latest commit

 

History

History
5 lines (5 loc) · 718 Bytes

File metadata and controls

5 lines (5 loc) · 718 Bytes

Reverse Array

  • This challenge is to write a function that will take in an array, and return an array that has the values of the input array in the reverse order.

Whiteboard Process

  • Whiteboard
  • I decided to use this approach because it was the most intuitive to me, as the reversed array gets bigger the index position needed from the given array gets smaller, and so the equation for that is super simple. There are other ways to accomplish this, such as recursion, but I think that would be a bit overkill for just reversing an array. I think the complexity of this function is O(N), because as the size of the input gets bigger, the number of iterations increases proportionally to it.