Re: Red black trees and other data structures (Simon Strobl)
> In order to use the red-black trees module in Yap you must do:
> :- use_module(library(rbtrees)).
Thanks.
I would like to try to state my other question more clearly:
Suppose I have a lot (e.g. several hundreds of Gigabyte) of facts of this form:
frequency('Aachen', 1234).
frequency('Aalen', 2345).
frequency('Berlin', 121212).
frequency('Baden Baden', 1218).
I suppose that I could save memory, if I put the words that are at the first argument place above into a prefix tree. (Is this correct?). But I do not see how I could use Yap's tries in such a way that the second argument can also be stored and looked up using the trie. What I want is something like:
?- search_tree_lookup('Aachen', Frequency).
Frequency = 1234.
yes
What structure should search_tree_lookup/2 use? Can it be done with tries?
Simon