[rust-dev] purely function red-black tree

Graydon Hoare graydon at mozilla.com
Mon Dec 17 11:28:03 PST 2012


On 12-12-14 03:51 PM, Steve Jenson wrote:
> I recently ported Matt Might's Scala port of Okasaki's purely functional
> red-black tree to Rust and am looking for some feedback.
> 
> https://github.com/stevej/rustled/blob/master/red_black_tree.rs
> 
> I've written this for 0.4 and will update it with other feedback I've
> received for 0.5 when that lands.

Nice! The only things I'd ask are:

  - I can't tell at a glance (sorry, RB-trees are always very subtle)
    whether this is an LLRB. If not, could you make it so? It's likely
    just a simplification to a couple of the functions.

  - Would you mind, once all feedback is incorporated, if we pull this
    into the stdlib? We have a bug open discussing cleanup and
    (re)organization of the container types, fwiw, over here:

    https://github.com/mozilla/rust/issues/3863

Thanks for taking an interest in this.

-Graydon


More information about the Rust-dev mailing list