title: Big O calculation for a function
body: <p>How to calculate O for a function?</p>
  
  <p>I need to know the O of this function. (and each of the loops)</p>
  
  <pre><code>int find_c(int n)
    int i,j,c
    for(i=n*n; i &gt; 1; i=i/4) //O(logn)
      for(j=n*n; j &gt; n/2; j--) //?
        c++
    for(i=c; i &gt; 0; i--) //O(c)
      if(random(0...99) &gt; 0) //O(1)
        for(j=n; j &gt; 0; j--) //O(n)
          c++ //O(1)
      else
        for(j=400; j &gt; 1; j--) //O(400)?
          c++ //O(1)
    return c
  </code></pre>