Algorithm to generate k element subsets in order of their sum
问题 If I have an unsorted large set of n integers (say 2^20 of them) and would like to generate subsets with k elements each (where k is small, say 5 ) in increasing order of their sums, what is the most efficient way to do so? Why I need to generate these subsets in this fashion is that I would like to find the k-element subset with the smallest sum satisfying a certain condition, and I thus would apply the condition on each of the k-element subsets generated. Also, what would be the complexity