title: What exactly is the "i" in this median task?
body: <p>Hey i have the task to write a code to compute the median from an array. I My teacher gave me the following instructions:</p>
  <p>Algorithm for the list l with length n &gt; 1 and the position i:</p>
  <ol>
  <li><p>divide the n elements from the list L in ⌊n/5⌋ groups with 5 elements and &lt;= 1 group with n mod 5 elements.</p>
  </li>
  <li><p>compute the median from each of the ⌈n/5⌉ groups</p>
  </li>
  <li><p>compute recursively the median x of the medians from step 2</p>
  </li>
  <li><p>partition the list L in 2 lists L1 with all numbers &lt; x and L2 with all numbers &gt; x. Also compute the length l1 and l2 of the lists (x will be on the position k = l1 + 1)</p>
  </li>
  <li><p>if i = k return x, if i &lt; k compute the first element of L1 recursively and if i &gt; k compute the (i-k)th element in L2 recursively.</p>
  </li>
  </ol>
  <p>So my question is, what exactly is the &quot;i&quot;? i already wrote the code and everything is working good, except step 5 because i don't know what the i is and how to use it. How is it defined and how does it change in the recursion?</p>