#Tree Root
A tree structure and utility library called Tree Root.
####Status This library is sill in an early stage of development. The first major release has not yet been made and the API has not been fixed. No formalised version scheme is currently being followed.
####Binary search tree example
final Trees trees = Trees.get();
final SortingTreeBuilder<Integer, BinaryTreeNode<Integer>> builder = trees
.treeBuilders()
.sortingTreeBuilder();
final BinarySearchTree<Integer> tree = builder
.addElement(2)
.addElement(1)
.addElement(3)
.build(BinarySearchTree.<Integer>typeKey());
tree
.addElement(4)
.addElement(6)
.addElement(5);
final Iterator<Integer> iterator = trees
.treeIterators()
.inOrderElementsIterator(tree);
while (iterator.hasNext()) {
System.out.println("Element: " + iterator.next());
}
This example builds a mutable, binary search tree and iterates over the elements in order, left, root, right, generating the output:
Element: 1
Element: 2
Element: 3
Element: 5
Element: 6
####Documentation
- Prior art
- Design principles
- Changelog
- API
- SPI
- Custom tree implementations
- Simple collections
- Iterators
- Tree reducers
####Targeted Language
The current target is Java 8. Some Java 8 features are being used in the API.
####License
Copyright (c) 2014, 2015 Matthew Champion
Licensed under BSD 3-clause license