B树实现

发布于 2024-10-08 20:00:11 字数 101 浏览 0 评论 0原文

我正在编写使用 B+ 树数据结构的数据库模型。我知道如何仅使用 RAM 在 Java 上实现此结构。但我需要将数据写入磁盘(每次写入、修改或删除时)

我该如何实现这个结构?

I'm writing the model of database which is using the B+ tree datastructure. I know how to implement this structure on Java using only RAM. But I need to write data on the disk(each time when I write, modify or delete)

How can I implement this structure?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

丿*梦醉红颜 2024-10-15 20:00:11

我建议使用图书馆。编写 BTree 在纸面上可能看起来很简单,但如果有数百万个项目并重新平衡,就会变得更加困难。

有一个 BTree/HTree 将其节点存储在磁盘上。它实现了Map和Set接口。
http://code.google.com/p/jdbm2/

此库的新版本是github 正在开发中:
https://github.com/jankotek/JDBM3

I would recommend using a library. Writting BTree may look simple on paper, but with a few millions items and rebalancing it gets harder.

There is an BTree/HTree which stores its nodes on disk. It implements Map and Set interface.
http://code.google.com/p/jdbm2/

New version of this library is under development at github:
https://github.com/jankotek/JDBM3

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文