Re: Red black trees and other data structures (Simon Strobl)

View: New views
2 Messages — Rating Filter:   Alert me  

Re: Red black trees and other data structures (Simon Strobl)

by Jose Santos :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In order to use the red-black trees module in Yap you must do:

:- use_module(library(rbtrees)).

(have a look at .pl files in directory /library from the Yap installation for all the possible libraries)
The manual should be updated to mention that the library must be loaded with this command (for all the other libraries the filename is available)

Kind regards,

Jose

 
Hello,

I want to use one of Yap's data structures to store large amounts of data
(such as frequency lists for strings).

I have two questions concerning this:

(1) How can I use red-black trees? The manual says a lot of things about
them, e.g. that a new red-black tree can be created with rb_new(T), but it
doesn't say which module to load.

I tried:

use_module(library(rb)).
use_module(library(redblack)).
use_module(library(redblacktrees)).

and many other names, but none of them worked.

(2) My main concern is memory efficency, i.e. the less memory a solution
needs the better. Which data structure should I use?

Simon
--
View this message in context: http://www.nabble.com/red-black-trees-and-other-data-structures-tp24090281p24090281.html
Sent from the Yap Prolog mailing list archive at Nabble.com.




------------------------------

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects

------------------------------

_______________________________________________
Yap-users mailing list
Yap-users@...
https://lists.sourceforge.net/lists/listinfo/yap-users


End of Yap-users Digest, Vol 29, Issue 1
****************************************


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Yap-users mailing list
Yap-users@...
https://lists.sourceforge.net/lists/listinfo/yap-users

Re: Red black trees and other data structures (Simon Strobl)

by Simon Strobl :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> 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