有m块石头,每块石头的重量已知,有可能有几块石头的重量相等。选择一些石头装进
背包,这样背包一共最多可能有2^m个可能的重量。把这些重量排序,第n个重量是多少?
由于组合数爆炸,把所有可能穷举再排序是不可行的。
http://spellscroll.com/questionfull/250/
Thursday, October 23, 2008
Subscribe to:
Post Comments (Atom)
A collection of all kinds of technical interview questions (programming, algorithm, probability, brainteaser, mathematics, etc.) from various companies (google, microsoft, yahoo, etc.)
No comments:
Post a Comment