Suffix Tree and similar

Hi,

I'm stuck with the app i'm writing and i really need some good ideas.

The basic problem is:

I generate a list of string, everytime i produce a new string i need to check if it is already present in the list, if not i add it to the list.

Each string is ordered and the list is ordered only respect to the first char.

To cope with that i used Tree structure similar to a Suffix Tree where i insert the string into the tree and it easily checks if the string is already present or not.

The tree works well but with strings of length 7 or more the heap goes out of bound.

Maybe i need a better implementation of the suffix tree,

do you know any?

or some other idea that requires lower space?

Thanks in advance!

[780 byte] By [Jocoa] at [2007-11-27 3:57:11]
# 1
Use a Hashset and not a list. It's exactly for that purpose.You can later still fill that Set into a List and use a Comparator for custom sorting.
CeciNEstPasUnProgrammeura at 2007-7-12 9:01:29 > top of Java-index,Java Essentials,Java Programming...