Example of Big O of 2^n : <p>So I can picture what an algorithm is that has a complexity of n^c, just the number of nested for loops.  </p>

<pre><code>for (var i = 0; i &lt; dataset.len; i++ {
    for (var j = 0; j &lt; dataset.len; j++) {
        //do stuff with i and j
    }
}
</code></pre>

<p>Log is something that splits the data set in half every time, binary search does this (not entirely sure what code for this looks like).  </p>

<p>But what is a simple example of an algorithm that is c^n or more specifically 2^n.  Is O(2^n) based on loops through data?  Or how data is split? Or something else entirely?</p>
