Java中Btree或B +树的现有实现 [英] Existing implementation of Btree or B+tree in Java
问题描述
在缺少关于问题的细节你需要解决,我将允许我自己提出一个可以解决你的问题的替代解决方案:使用一个红色/黑色的树。
红/黑树可以被认为是一个b树,如在维基百科:
一个红黑树的结构类似于第4类B树,其中每个节点可以包含1到3个值和(相应地)2到4个子指针之间。在这样的B树中,每个节点将仅包含与红黑树黑色节点中的值相匹配的一个值,并且在同一节点之前和/或之后的可选值匹配一个等效的红色节点红黑树[...]
Java有两个内置类, TreeMap 和 TreeSet ,提供红/黑树。这些都不会将字符串作为输入并从其中生成树,但是您可能可以实现类似围绕其中一个类的类。
I am doing a project in which I require btree or b+tree data structure. Does anyone know of an existing implementation of btree or b+tree (with insert, delete, search algorithms)? It should accept string as input and form btree or b+tree of these string.
In the lack of details about the problem that you need to solve, I am going to allow myself to suggest an alternative solution that might solve your problem: use a red/black tree instead.
The red/black tree can be thought of as a b-tree, as explained on Wikipedia:
A red-black tree is similar in structure to a B-tree of order 4, where each node can contain between 1 to 3 values and (accordingly) between 2 to 4 child pointers. In such B-tree, each node will contain only one value matching the value in a black node of the red-black tree, with an optional value before and/or after it in the same node, both matching an equivalent red node of the red-black tree [...]
Java has two built-in classes, TreeMap and TreeSet, providing red/black trees. None of these will take a string as input and grow a tree from it, but you might be able to implement something similar "around" one of those classes.
这篇关于Java中Btree或B +树的现有实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!