Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Words in Words

by thezip (Vicar)
on Sep 30, 2011 at 18:06 UTC ( #928886=note: print w/replies, xml ) Need Help??

in reply to Words in Words

While I'm not an expert on tries, there seems to be a lot of potential there for your stated problem. Give it a look.

Here's a trie implementation in Perl.

What can be asserted without proof can be dismissed without proof. - Christopher Hitchens

Replies are listed 'Best First'.
Re^2: Words in Words
by LanX (Chancellor) on Oct 01, 2011 at 09:44 UTC
    yes searching in Suffix_tree is O(1), but constructing those trees implies a overhead.

    Since in our case all searched strings are also known in advance, I'm not sure that this is really the fastest approach.

    At least the construction process will already identify embedded strings, since they are leaves of the suffix tree.

    Cheers Rolf

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://928886]
[stevieb]: "Happy Monk Day, you've been here 8 troublesome years". Tack on another 8 before I signed up :)

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2017-08-19 15:49 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (311 votes). Check out past polls.