Skip to main content
GameDev.net gamedev.net
🔒 Locked

2-3-4 Tree

Started by Chaucer Dec 4, 2002 at 9:44 PM 4 replies 600+ views
Original Post
Chaucer
Chaucer
I''ve been working on coding a 2-3-4 tree and was wondering if anyone here could point me to some resources on it. I''m having a bit of trouble in the code so maybe a resource with sample code would help. Thanks.
Thanks!
Psylent
Psylent

You may know this already, but the easiest way to code a 2-3-4 tree is to program what is known as a Red Black Tree (which is essentially a binary tree with an extra bit of data that gives it 2-3-4 properties).
Chaucer
Chaucer
Yeah. I've done rb trees in the past. I think it would be better for me to learn the 2-3-4 tree correctly.

[edited by - Chaucer on December 4, 2002 12:45:25 AM]
Thanks!
Psylent
Psylent
Why code it though?

I was under the impression that both algorithms do the same thing. If 2-3-4 trees are cumbersome to program in comparison to rb, wouldn't creating one would be more likely to produce erreonous code and be inefficient?

I'm not trying to flame or anything, just curious.

[edited by - Psylent on December 5, 2002 4:28:50 AM]
Chaucer
Chaucer
It''s a personal challenge that I''d like to overcome.
Thanks!
Premandrake
Premandrake
Google is your friend.

This was the first thing it hit upon when I searched on "2-3-4 tree".

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.