title: Run time complexity for Reversal of array?
body: <p>Why the run time complexity for this logic is O(N)? The number of iterations are only half here. Please explain!</p>
  
  <pre><code>for(int i = 0; i &lt; validData.length / 2; i++)
  {
      int temp = validData[i];
      validData[i] = validData[validData.length - i - 1];
      validData[validData.length - i - 1] = temp;
  }
  </code></pre>