title: Understanding Big O
body: <p>Given the following code, what is the complexity of <em>3.</em> and how would I represent simple algorithms with the following complexities?</p>
  
  <p>O(n²+n)<br>
  O(n²+2n)<br>
  O(logn) 
  O(nlogn)</p>
  
  <pre><code>var collection = new[] {1,2,3};
  var collection2 = new[] {1,2,3};
  
  //1.
  //On
  foreach(var i in c1)
  {
  }
  
  //2.
  //On²
  foreach(var i in c1)
  {
    foreach(var j in c1)
    {
    }
  }
  
  //3.
  //O(nⁿ⁺ᵒ)?
  foreach(var i in c1)
  {
    foreach(var j in c2)
    {
    }
  }
  </code></pre>