From: Roger Pack Date: 2009-12-16T05:17:01+09:00 Subject: [ruby-core:27178] Re: [Feature #2348] RBTree Should be Added to the Standard Library > 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