Results 1 to 4 of 4
Thread: 2-4 tree
- 12-08-2009, 06:51 PM #1
Member
- Join Date
- Dec 2009
- Posts
- 2
- Rep Power
- 0
2-4 tree
Hi, I havo to implement a 2-4 tree, but I have some problems;
I have create the Entry class, my 2-4 tree will contain Entry objecs..but I don't know I can realize the node of the tree! In my book is said to realize the node using an array. How can I do it?
Thank you
P.S.: I'm sorry for my english but I'm not english
- 12-09-2009, 12:01 AM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 294
- Rep Power
- 0
I have no clue what a 2-4 tree is, + node (hum...) reminds me of a 3d engine for python...
Are you scripting with java using a "not included" package like 3d engine?
- 12-09-2009, 12:39 PM #3
Member
- Join Date
- Dec 2009
- Posts
- 2
- Rep Power
- 0
Yes..I don't use any package..
- 12-09-2009, 04:52 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
A 2-4 tree is a B-tree ('B' doesn't stand for 'binary'); every node has between 2 and 4 data items except for the root node, it has between 0 and 4 data items. For two data items i1 and i2 (i1 < i2) lies a pointer to a child node that contains all the data items between i1 and i2 (exclusive). The tree is balanced; if after an insertion a node contains more than 4 items the node is split and the check is done again for the parent node, all the way to the root; if the root needs to be split a new root node is created. Similar with deletes: if a node contains less than 2 items the node is joined with a neighbour node (if possible, otherwise an item is borrowed from the parent and the check needs to be made again, all the way to the root). My guess is that Google is your friend here because there are quite some details to get right.
kind regards,
Jos
Similar Threads
-
Binary Tree
By MuslimCoder in forum New To JavaReplies: 8Last Post: 11-19-2009, 06:57 PM -
Help Tree Set
By ShuiYinDeng in forum New To JavaReplies: 2Last Post: 10-29-2009, 11:45 AM -
Creating a Tree and then saving the Tree
By jackmatt2 in forum New To JavaReplies: 0Last Post: 08-22-2009, 01:51 PM -
B tree
By wide in forum New To JavaReplies: 2Last Post: 07-01-2009, 12:37 AM -
Need Help With Tree Adt
By avi in forum New To JavaReplies: 0Last Post: 03-20-2008, 04:11 AM
Bookmarks