Alex Rivera | Logout

Trie vs. suffix tree vs. suffix array

Asked 2010-03-21T15:26:09.297
46

Which structure provides the best performance results; trie (prefix tree), suffix tree or suffix array? Are there other similar structures? What are good Java implementations of these structures?

Edit: in this case I want to make string matching between a large dictionary of names and a large set of natural language texts, in order to identify the names of the dictionary on texts.

Edit
Report

2 Answers

4

What operations do you plan on doing? libdivsufsort was at one time the best suffix array implementation in C.

answered 2011-03-31T01:01:57.083
1

EDIT: In this case I want to make string matching between a large dictionary of names and a large set of natural language texts, in order to identify the names of the dictionary on texts.

This sounds like an application for the Aho-Corasick algorithm: construct an automaton from the dictionary (in linear time), which can then be used to find all the occurrences of any of the dictionary words in multiple texts (also in linear time).

(The description in these lecture notes, linked from the "External links" section of the Wikipedia page, is a lot easier to read than the description on the page itself.)

answered 2010-03-21T17:51:21.260

Your Answer