Member Avatar for Ajantis

Hello,

I was just wondering if anyone knows where I can find a GOOD tutorial on Red Black trees in JAVA? I was reading the Mark Allen Weiss book on Datastructure's but I don't understand much... especially when it comes to the insertions and deletion. Finding useful and concrete information about Red Black Trees seem difficult!

Maybe you should read what you have more slowly and carefully. If you can't understand something just because it's not laid out for you in just the comfortable manner, you need to learn how.

Member Avatar for Ajantis

Maybe you should read what you have more slowly and carefully. If you can't understand something just because it's not laid out for you in just the comfortable manner, you need to learn how.

I think I am doing my best at all times. I've been reading through the same pages for 10+ hours with no success. So I am trying to find a better tutorial which explains it in a way that I can understand. :)

>I was just wondering if anyone knows where I can find
>a GOOD tutorial on Red Black trees in JAVA?

This tutorial uses C, but it's easily translated into Java. I think it's one of the better ones out there, but I'm biased. :D

>I was reading the Mark Allen Weiss book on Datastructure's
My feeling on his book is "meh". It's not exceptional either in code or explanation of red black trees. In general, books fail to follow through completely on the parts that people have most trouble with, such as deletion.

The approach I recommend taking to red-black trees is to (1) understand the constraints of a red-black tree and why they mean the tree is balanced, and (2) implement the tree yourself, in a convenient programming language.

It's fairly straightforward to understand why the constraints lead to a balanced tree -- they just implicitly bound the depth of the tree. The rest is just implementation details, and that's something you understand best by implementing it. Figure out how to add and remove elements while maintaining the constraints, yourself.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.