Filip Konvička wrote:
I have a wish for one of the future releases. I think that Mozart lacks
some common data structures in the standard library. I think one of the
most needed is a sorted associative container. Another such structure is
a priority queue. I wonder why those did not make it into the Mozart's
stdlib - I see it as a drawback for beginners who are used to C++'s or
Java's stdlib.
Well, few people propose to contribute...
To be constructive, I attach an implementation of sorted associative
container that uses a red-black tree and a double-linked list (it is not
as generic as could be, but could be enhanced easily).
I am a bit surprised by the way you use object features, because you use
them as class features. (Some people even consider those features as a
design mistake.) Why don't you use standard methods?
local
class RBTree
feat
new:% Creates a new red-black tree
fun {$} {New RBTree Init} end
Cheers,
raph
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users