V
- vertex typeE
- edge typepublic interface RootedTree<V,E extends Arc<V>> extends Tree<V,E>, DAGraph<V,E>
Modifier and Type | Method and Description |
---|---|
int |
depth(V v)
Gets the (unweighted) distance of a vertex from the root of the vertex.
|
int |
height()
Gets the maximum depth in this tree.
|
V |
root()
Gets the root of this tree.
|
RootedTree<V,E> |
subTree(V v)
Gets a sub-tree starting from a vertex.
|
topologicalOrder
children, incomingArcs, outgoingArcs, parents
addEdge, addVertex, edges, edges, removeEdge, removeVertex, vertices
V root()
int depth(V v)
v
- the vertex whose depth is to be computedint height()
RootedTree<V,E> subTree(V v)
v
- the root of the sub-treeCopyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.