writeaprogramtofindthelargestpossiblerectangleofletterssuchthatevery
rowformsaword (读左到右) andeverycolumnformsaword (读左到右) readingtopto
bottom ).wordsshouldappearinthisdictionary : word.lst (1.66 MB ).Heuristic solutions
thatmaynotalwaysproduceaprovablyoptimalrectanglewillbeaccepted : seeka
reasonabletradeoffofefficiencyandoptimality。
Example
Fromcat、car、ape、api、rep、tipwegetthefollowingrectangle (whichisasquare ) :
c a ra p et i p stackoberflow显示的链接简单来说就是递归回溯。 但是mitbbs提出的提示是(Hint: Use a B-Tree )。 我想不出为什么在使用b树,也打不开他的链接。 这个问题需要解决。 等待代码变为ing。
参考:
33558堆栈覆盖.com/questions/8512174/largest-possible-rectangle-of-letters