Need memory efficient way to store tons of strings (was: HAT-Trie implementation in java)

The trie seems like a very good idea for your constraints. A “thinking outside the box” alternative: If you can afford some probability of answering “present” for a string that is absent EDIT: if you can afford false positives, use a Bloom filter as suggested by WizardOfOdds in the comments. For k=1, a Bloom filter … Read more

How do you store a trie in a relational database?

How about the Materialized Path design? CREATE TABLE trie ( path VARCHAR(<maxdepth>) PRIMARY KEY, …other attributes of a tree node… ); To store a word like “stackoverflow”: INSERT INTO trie (path) VALUES (‘s’), (‘st’), (‘sta’), (‘stac’), (‘stack’), (‘stacko’), (‘stackov’), (‘stackove’), (‘stackover’), (‘stackover’), (‘stackoverf’), (‘stackoverflo’), (‘stackoverflow’); The materialized path in the tree is the prefixed sequence … Read more

Implementing a simple Trie for efficient Levenshtein Distance calculation – Java

From what I can tell you don’t need to improve the efficiency of Levenshtein Distance, you need to store your strings in a structure that stops you needing to run distance computations so many times i.e by pruning the search space. Since Levenshtein distance is a metric, you can use any of the metric spaces … Read more

Is there a Trie in Java? [duplicate]

There is no trie data structure in the core Java libraries. This may be because tries are usually designed to store character strings, while Java data structures are more general, usually holding any Object (defining equality and a hash operation), though they are sometimes limited to Comparable objects (defining an order). There’s no common abstraction … Read more

Difference between Tries and Trees?

A tree is a general structure of recursive nodes. There are many types of trees. Popular ones are binary tree and balanced tree. A Trie is a kind of tree, known by many names including prefix tree, digital search tree, and retrieval tree (hence the name ‘trie’). Each kind of tree has a different purpose, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)