title: Rearrange a sorted array
body: <p>I have a sorted array in ascending order. I have to build a new array in such a way that the last element of the sorted array will be the first element of the new array and the first element of the sorted array will be next element of the new array and so on.
  For example- </p>
  
  <pre><code>//if a[] is the sorted array.
  a[]={1,2,3,4,5}
  
  //output-
  //b[] is the new array.
  b[]={5,1,4,2,3}
  </code></pre>
  
  <p>My approach is-
  Using two index <code>i</code> and <code>j</code>.</p>
  
  <pre><code>for (int i = 0, j = 0; j&lt; count; i++, j++)
  {
      b[j] = a[count - (i + 1)];
      b[++j] = a[i];
  }
  </code></pre>
  
  <p>Now Question is how to do this using only a single index i.e using only index <code>i</code> from my example.</p>
  
  <p>Thanks in advance!</p>