title: Finding the T(n) of An Algorithm
body: <p>Okay so when my professor was going over it in class it seemed quite simple, but when I got to my homework I became confused. This is a homework example.</p>
  
  <pre><code>for (int i = 0; i &lt; n; i++)    // I know this runs at T(n)
   for (int j = n - 1; j &gt;= i; j--)
   cout &lt;&lt; i &lt;&lt; " " &lt;&lt; j &lt;&lt; endl; 
  </code></pre>
  
  <p>Here's an example I understand</p>
  
  <pre><code>for(int i=0; i&lt;n-1; i++) {
    for(int j=i+1; j&lt;n; j++) {
      1 Simple statement
     }
  </code></pre>
  
  <p>For that example I just plugged in 0, 1, and 2. For 0, it ran for n-1, at 1 for n-2 and at 2 n-3. So I think that for the homework example if I plugged in 0 it would run for n+1 since j has to be greater than or equal to i which is 0. If it's not obvious, i'm pretty confused. If anyone could show me how to solve it, that'd make my day. Thanks guys.</p>