> Additionally I believe it performs O(n) while hash should be O(c). > Btw. is there need for SortedArray with Array.index O(n log n)? The Container Library, container.rb, provides Set, Bag, OrderedCollection, SortedCollection, LinkedList. This may suite for your purpose. But I don't know where(URL) it is. Hmm... Perhaps in RAA or somewhere. And tips: > self.each_index{|c| ret[self[c]] = c } Why don't you use this? :) : self.each_with_index{|e,c| ret[e] = c } Regards, -- Hideto "rubyholic" ISHIBASHI