Re: find words that contains some specific letters
On Jun 1, 2:06 pm, Tom Anderson <t...@urchin.earth.li> wrote:
On Mon, 1 Jun 2009, Lew wrote:
Giovanni Azua wrote:
Doing the map lookup you get these four SortedSet back. Finally calcu=
lating
the interception of these four SortedSet you get the desired result e=
..g.
Could you explain what you mean by "the interception of these four
SortedSet[s]"? I don't understand that part.
I assume he means 'intersection'. I mean, intersection, interception,
O(1), O(c), what's the difference, right?
I figured it meant "intersection", too, but that's the part I don't
understand. What does it mean to take an intersection of the result
sets?
With a HashSet approach, you take each of the n! permutations of the
search string and determine 'dictionary.contains( permutation )'. The
result you want is the union of the permutations that return 'true'.
I do not understand why there would be a test for portions of the
search string, much less taking an "intersection" of those results.
With a HashMap<String, Set<String>> approach, the entire Set of
resultant dictionary words is indexed by the search string, so one
simple 'dictionary.get( searchTerm )' yields an entire result set
directly.
So I remain puzzled, and still need the answer.
--
Lew