[erlang-questions] (newbie) Using Functions as Guards in Erlang

Robert Virding <>
Mon Jun 16 03:15:45 CEST 2008

2008/6/16 Fuad Tabba <>:

> Robert: I've based my delete algorithm on the one at
> http://sage.mc.yu.edu/kbeen/teaching/algorithms/resources/red-black-tree.html, would definitely be interested in a faster algorithm. Is it the one you're
> using for the rbdict you posted?

Looking over my code again, it was a while back I wrote it, it looks like
the algorithm in the link you mentioned is the one used in the extra file
rbdict1.erl I included in the package. I have a macro DBLACK for the doubly
black token so it seems like it. I also see that I don't have any
implementation of the deletion algorithm in the first haskell version from
http://www.cs.kent.ac.uk/people/staff/smk/redblack/rb.html. I will have to
try this and see how it matches up with the others.

I have a little test program I use for testing various dictionaries which I
include here. It is uncommented but generates lots of test cases, compile it
with the 'E' option to see what all the macros generate. Macros are really
useful but they are much easier in lisp. Should really redo the file in LFE.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080616/6e6608ff/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: db_test.erl
Type: application/octet-stream
Size: 4615 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080616/6e6608ff/attachment.obj>

More information about the erlang-questions mailing list