Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^3: Challenge: 8 Letters, Most Words (2of12int.txt in 20^H^H 10 secs; Pure Perl)

by BrowserUk (Pope)
on Oct 09, 2013 at 16:37 UTC ( #1057584=note: print w/replies, xml ) Need Help??

in reply to Re^2: Challenge: 8 Letters, Most Words (2of12int.txt in 20^H^H 10 secs; Pure Perl)
in thread Challenge: 8 Letters, Most Words

It does recurse through all 8-letter combos, but short-circuits at each level if the combination so far cannot be derived from the dictionary supplied.

next unless exists $tree->{ $_ };

If the letter combination for your 'eehnortw' existed in the dictionary, it would be found very quickly:

[17:25:23.81] C:\test>type hdb.dict exactest one two three four five six seven eight nine ten torewhen [17:25:47.91] C:\test>1056884-calc hdb.dict 0.00380706787109375 [5] eehnortw : torewhen three one two ten [1] aceesttx : exactest

Comment out the short-circuit and it will consider all 8-letter possibilities .. and run more slowly.

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1057584]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2017-12-14 19:06 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (406 votes). Check out past polls.