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?
P.S.: I'm sorry for my english but I'm not english
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?
Yes..I don't use any package..
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.