Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
由于缺乏有关您需要解决的问题的详细信息,我将允许自己提出一个可能解决您的问题的替代解决方案:改用红/黑树。
红/黑树可以被认为是 B 树,如 Wikipedia 上的解释:
Java 有两个内置类, TreeMap 和 TreeSet,提供红/黑树。这些都不会将字符串作为输入并从中生成一棵树,但您也许能够“围绕”其中一个类实现类似的东西。
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:
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.
jdbm 有一个非常可靠的 b+tree 实现。还有h+tree,这是一个有趣的相关数据结构。
jdbm has a very solid implementation of b+tree. Also h+tree which is an interesting related data structure.
我必须实现自己的开源代码。
I've had to implement my own and open sourced the code.
您可以尝试 Electric 的 BTree (作者页面)。
You could try Electric's BTree (author page here).