求一道 面世题 的解答思路# JobHunting - 待字闺中
b*f
1 楼
Word Rectangle
Write a program to find the largest possible rectangle of letters such that
every row forms a word (reading left to right) and every column forms a word
(reading top to bottom). Words should appear in this dictionary: WORD.LST (
1.66MB). Heuristic solutions that may not always produce a provably optimal
rectangle will be accepted: seek a reasonable tradeoff of efficiency and
optimality. (Hint: Use a B-Tree)
我只能想到把词典里的单词按长度分组,然后穷举法。感觉这样的话计算机要被搞死。
不知道哪位大虾有什么巧妙的方法!!
Write a program to find the largest possible rectangle of letters such that
every row forms a word (reading left to right) and every column forms a word
(reading top to bottom). Words should appear in this dictionary: WORD.LST (
1.66MB). Heuristic solutions that may not always produce a provably optimal
rectangle will be accepted: seek a reasonable tradeoff of efficiency and
optimality. (Hint: Use a B-Tree)
我只能想到把词典里的单词按长度分组,然后穷举法。感觉这样的话计算机要被搞死。
不知道哪位大虾有什么巧妙的方法!!