Closed Col-E closed 2 years ago
Idea:
interface Tree<T> { T data(); Tree<T> parent(); List<Tree<T>> children(); }
May want a keyed variant too:
interface KeyedTree<K, T> extends Tree<T> { Map<K, Tree<T>> keyedChildren(); }
Assuming both are implemented, having an add(...) type would be nice on the core Tree type. But this would mean the keyed type would then have to derive K from T if it wanted to adapt to a put(...) sort of operation....
add(...)
Tree
K
T
put(...)
What degree of detail in offered implementations should be offered? For instance, some types of trees: https://www.educative.io/blog/data-structures-trees-java
https://github.com/Col-E/ExtraCollections/commit/a813bf87f50c1a9ebe7df1ba2ba6ed0a3ed76fc0
Idea:
May want a keyed variant too:
Assuming both are implemented, having an
add(...)
type would be nice on the coreTree
type. But this would mean the keyed type would then have to deriveK
fromT
if it wanted to adapt to aput(...)
sort of operation....What degree of detail in offered implementations should be offered? For instance, some types of trees: https://www.educative.io/blog/data-structures-trees-java