Jump to content
  • Advertisement
Sign in to follow this  
ace84_84

[java] Red Black Tree

This topic is 4479 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I am learning about red-black trees, and i am having trouble with the insertion method for a bottom-up tree. I understand and wrote the code for the insertion method of the top-down tre, but i am having a little trouble figuring out how it works, any help??? Thanks

Share this post


Link to post
Share on other sites
Advertisement
Do you do this for learning pourposes? std::map uses red black tree.

when you finally understand how it works, I advice you to use std's one which is faster than any other implementation I've found.

Share this post


Link to post
Share on other sites
He's talking about Java, dude ;)

PM me with your email, and I'll send you material about data structures in Java. AFAIK, there's no RBTree in the Collections Framework, but it is quite straightforward to implement your own.

Son Of Cain

Share this post


Link to post
Share on other sites
Are there *any* trees in the Collections framework? I've never seen any, which I've always found (murder-inducingly) odd.

Share this post


Link to post
Share on other sites
Quote:
Original post by Kevinator
Are there *any* trees in the Collections framework? I've never seen any, which I've always found (murder-inducingly) odd.


Hehehe, true =D

But take it easy Kev.. Java and its OOP.. makes writting it a breeze ;)

Never searched Apache's Commons Collections. Do they have it?

Son Of Cain

Share this post


Link to post
Share on other sites
Look into source code of standard library, there is an implementation of a Red -Black tree. IIRC.

Some of the n * log(n) tructure/s is/are implemented this way. Possibly Set, or simillar sorted collection/s. (Try to remmember advantages of this type of tree, and try to guess what data structure would use them well.)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!