Algorithm to find the best combination of items under certain constraints

前端 未结 7 1588
长情又很酷
长情又很酷 2021-01-06 14:22

I\'ll try to explain the problem in the math language.
Assume I have a set of items X = {x_1, x_2, ..., x_n}. Each item of X belongs to one of

相关标签:
7条回答
  • 2021-01-06 15:02

    Consider using a lookup table to optimize the time of f1. Consider inserting subsets you discover into merge sorted list instead of quicksorting at the end. If the domain is small and finite you can implement some very fast merge sorts by populating sparse arrays.

    0 讨论(0)
提交回复
热议问题