What's the fastest way to generate k-set from a list of integers?
<p>I want to generate all k-set(k=2 to 4) which always contains the first element 0 from an ordered list of integer {0, 1, 2, 3}:
[{0,1},{0,2},{0,3},{0,1,2}, {0,1,3},{0,2,3},{0,1,2,3}].</p>

<p>Currently, my way is 
* m=2: [{0,1},{0,2},{0,3}],
* m=3: derived from m=2 by only adding element in the list which is bigger than the biggest element of (m-1) set: [{0,1,2}, {0,1,3}, {0,2,3}}], for example, here [2,3] are bigger than the 1 which is the biggest integer the set {0,1}, so they are added and I got 2 more sets {0,1,2},{0,1,3}.</p>

<p>It works but when n is big it's not fast enough.</p>

<p>I wonder what's the faster way to generate these sets.</p>