On 03/30/2011 05:02 AM, dsimcha wrote:
On 3/29/2011 8:37 PM, Jonathan M Davis wrote:
We now have std.container.RedBlackTree, which can be used as a set, but it is
a tree rather than a hash table.

- Jonathan M Davis

This isn't a very good set. It doesn't even support basic set primitives like
intersection, difference, union, etc. Furthermore, most programs will probably
want a hash set. A tree set is only better when you don't have a good hash
function or worst case performance is more important than average case.

I'm not saying there's anything wrong with RedBlackTree. It's a perfectly good
data structure to implement a set on top of. It's just that it's not a "real"
set type because it's not meant to be.

Yep, but with balanced binary search trees you get sorting for free ;-)

Denis
--
_________________
vita es estrany
spir.wikidot.com

Reply via email to