Show that the code below runs in Θ(nlogn) time
<p>This is a homework question and I really need help on this one and I hope somebody helps me out with it </p>

<blockquote>
  <p>We have n electric light bulbs, with labels from 1 to n. The light
  bulbs are all turned OFF initially. Each light bulb has a switch, so
  that flipping the switch will change its status from ON to OFF, or
  from OFF to ON. At the i-th round, for i=1,2,....,n we will flip the
  switches of those light bulbs whose labels are a multiple of i, and we
  are interested to know which light bulbs will be ON after the n-th
  round. </p>
  
  <p>We can compute the final status of each light bulb using the following
  code: </p>

<pre><code>Intialize A[1...n] so that each entry is OFF;
for(round i=1,2,...,n) {
  for (position j=i,2i,3i,...){
    if(j&lt;=n) Flip A[j];
    else break;
  }
}
</code></pre>
  
  <ol>
  <li><p>Show that the obove code runs in O(n^2) time</p></li>
  <li><p>Show that the above code runs in Θ(nlogn) time.</p></li>
  <li>Design a faster algotithm that can compute the final status in O(n) time.</li>
  </ol>
</blockquote>