> Feature #2348: RBTree Should be Added to the Standard Library
+1
Perhaps something like this would be useful for it (from
http://www.ruby-forum.com/topic/68018)
class SortedList
def initialize *elems
@rbt = RBTree.new
insert *elems
end
def insert *elems
elems.each{|e| @rbt[e] = e}
self
end
alias_method "<<", "insert"
def to_a() @rbt.values end
def inspect() to_a.inspect end
class << self
alias_method "[]", "new"
end
end