HeadlinesBriefing favicon HeadlinesBriefing.com

ChaosTree: 依存性ゼロ Java ツリーライブラリ

Hacker News •
×

What is Chaos Tree? Chaos Tree is a Java Sorted Set/Map library built around multiple search-tree data structures, including AVL Trees, Red-Black Trees, B-Trees, and B+ Trees. The library provides both Set and Map implementations, with APIs designed around the semantics of the JDK's Navigable Set, Navigable Map, Sequenced Set, and Sequenced Map contracts. In addition to the standard collection APIs, Chaos Tree provides specialized construction APIs for users who want direct control over the initial structure of N-ary trees, such as buildFromSorted(Iterator, factor) and importFlatMatrix(Object[][], factor).

These APIs allow users to control the target node occupancy through a configurable factor in the supported range [0.5, 1.0], while maintaining the structural invariants required by the underlying B-Tree/B+Tree design. Correctness & Validation Chaos Tree is validated through multiple layers of testing: Guava Testlib compatibility testing, jqwik property-based testing, randomized differential testing against reference collections, white-box structural validation of tree nodes, direct validation of B-Tree/B+Tree structural invariants, exception and iterator-contract testing, serialization and cloning tests. The structural tests inspect the internal tree representation rather than relying solely on externally observable behavior.

This provides an additional layer of validation for node occupancy, ordering, topology, and balancing invariants. Performance claims are backed by JMH benchmarks and hardware-counter-backed evidence, with reports available at the project's GitHub pages. GitHub: https://github.com/Chaos-vy/ChaosTree.