Efficiently enumerate all subsets of an ordered set
One possibility is to generate separately all subsets of size $k$ using the following recursive approach:


  A $k$-subset of $a_1,\ldots,a_n$ is either a $k$-subset of $a_2,\ldots,a_n$ or $a_1$ adjoined to a $(k-1)$-subset of $a_2,\ldots,a_n$.


Run this recursive algorithm for $k=0,\ldots,n$. If you're careful, you will get a lexicographically ordered output.