Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

How to store "infixes"

Name: Anonymous 2009-09-16 7:58

I need to store all possible infixes of words (and their location) to be able to quickly make queries.

(eg. anus -> a, n, u, s, an, nu, us, anu, nus, anus)

Problem is, even with small files, if you store "infix->list of positions", the index gets really really really large (obviously).

I have been trying to think of a data structure to reduce storage needed, but... I failed. Any ideas?

Name: Anonymous 2009-09-16 22:26

>>4
You doubt suffix trees use less space than brute force storage? I wasn't able to verify, but I'm pretty sure it's O(input size). Your algorithm is O(2^(input size)). Suffix trees win.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List