Suppose you are given an $n$-dimensional simplexS = [ 0 1 ... n ]which for the time being we think of as an ascending array of numbers from $0$ to $n$. Given $1 \leq k \leq n$, how can we enumerate the $k$-faces of S, i.e. the $k$-dimensional subsimplices? - In less geometric words, we want a complete and multiples-free list of all $k$-sized strictly ascending sequences of numbers between in $\{ 0, \dots , n \}$.The straight-forward algorithm is to create the list of all $k$-sized tuples of numbers between $0$ and $n$, and pop out those that are not strictly ascending or contain duplicates. This can be done in space and time $O(n^3)$.But can we do better? We do not impose restrictions on a particular ordering of the output.
List the $k$-faces of an $n$-dimensional simplex
cg.comp geom;permutations
See chapter 3 of Nijenhuis and Wilf, Combinatorial Algorithms (the entire book is available free online and despite its age contains many useful algorithms).