Provide an api for trees
MIT License
A tree is a hierarchical data structure made up of nodes, starting from a root node and branching out into subnodes. Each node contains a value and can have multiple children, with the rule that no child points back to the root or shares any duplicate connections. This structure forms a recursive, non-linear representation of data, ideal for modeling hierarchical relationships.
Key Terminology:
Tree Traversal Methods:
Tree Representation Methods:
Expression Trees: Expression trees represent mathematical expressions in a structured way, where operators and operands are arranged to clarify precedence. Traversing this tree using pre-order or post-order traversal helps evaluate or transform the expressions into infix, prefix, or postfix forms.
Structural Induction: A method for proving the correctness of tree-related algorithms. It involves proving a base case (a tree with a single node) and then showing the correctness of the recursive case (a tree with subtrees).
The ITree<V, T>
interface provides a generic structure for representing trees where each node can hold a value of type
V
and have children of type T
. This flexible design allows for building complex hierarchical models while keeping
the structure modular and reusable.
Please support this project by simply putting a Github Star ⭐
Share this library with friends on Twitter and everywhere else you can
If you love this project
No animals were harmed in the making of this library.
The source code comes under the liberal MIT License, making tree-api great for all types of applications.
Replace the variable ${latestVersion} with the current latest version:
You can first define the version in the ext section and add than the following gradle dependency to
your project build.gradle
if you want to import the core functionality of tree-api:
define version in file gradle.properties
treeApiVersion=${latestVersion}
or in build.gradle ext area
treeApiVersion = "${latestVersion}"
then add the dependency to the dependencies area
implementation("io.github.astrapi69:tree-api:$treeApiVersion")
Maven dependency is now on sonatype. Check out sonatype repository for latest snapshots and releases.
Add the following maven dependency to your project pom.xml
if you want to import the core
functionality of tree-api:
Then you can add the dependency to your dependencies:
<properties>
...
<!-- tree-api version -->
<tree-api.version>${latestVersion}</tree-api.version>
...
</properties>
...
<dependencies>
...
<!-- tree-api DEPENDENCY -->
<dependency>
<groupId>io.github.astrapi69</groupId>
<artifactId>tree-api</artifactId>
<version>${tree-api.version}</version>
</dependency>
...
</dependencies>
This project is kept as an open source product and relies on contributions to remain being developed. If you like this library, please consider a donation
over paypal: or over bitcoin(BTC) with this address:
bc1ql2y99q7e8psndhcc3gferk03esw3qqf677rhjy
or over FIO with this address:
FIO7tFMUVAA9cHiPPqKMfMXiSxHrbpiFyRYqTketNuM67aULuwjop
or over Ethereum(ETH) with:
0xc057D159D3C8f3311E73568b334FF6fE82EB2b7D
or over Ethereum Classic(ETC) with:
0xF708cA86D86C246B69c3F4BAe431eBbe0c2bfddD
or over Dogecoin(DOGE) with:
D5yi4Um8cpakd6yPRm2hGWuQ5nrVzhSSW1
or over Monero(XMR) with:
49bqeRQ7Bf49oJFVC72pqpe5hFbb62pfXDYPdLsadGGF81KZW2ZfrPZ8PbAVu5X2v1TYAspeczMya3cYQysNS4usRRPQHVw
or over flattr:
or over the donation buttons at the top.
The versions of tree-api are maintained with the Semantic Versioning guidelines.
Release version numbers will be incremented in the following format:
<major>.<minor>.<patch>
For detailed information on versioning you can visit the wiki page.
You can donate or contribute solve issues or pull request. Every support are welcome.
The source code for tree-api are on GitHub. Please feel free to fork and send pull requests!
Create your own fork of astrapi69/tree-api/fork
To share your changes, submit a pull request.
Don't forget to add new units tests on your changes.
Do not hesitate to contact the tree-api developers with your questions, concerns, comments, bug reports, or feature requests.