Can someone tell me where I can find code for 2-3 tree, such as insert, delete or find in a 2-3 tree, or if anyone had done it before please help me with it. Or even books that have code of 2-3 tree, I would really appreciate any help, thank you!
Can someone tell me where I can find code for 2-3 tree, such as insert, delete or find in a 2-3 tree, or if anyone had done it before please help me with it. Or even books that have code of 2-3 tree, I would really appreciate any help, thank you!
What's a 2-3 tree??? If it's a tree, then I have done quite a few.
Basically you'll need Node class with functions like :
struct Node
{
Node* getKids();
int getNbKids();
void addKid();
};
Then you'll need a Tree class with an iterator, like :
struct Tree
{
void setIteratoRoot(Node* root);
Node* getNextNode();
};
The iterator idea will let you step through the tree (for example to find a Node). The node class will allow you to insert kids, or delete a branch.
You create generic Node and Tree classes which you will then subclass to add attribute and functions specific to your application.
Hope this helps.
Yes it is one of the tree type, a 2-3 tree is a tree with a maximum of 2 or 3 children. but I'm stuck in this insertion thing. That's why I need someone who has done it before and show me the code.
So really no one can help me with this? Come on! I really would appreciate any help!