path

fun path(descendant: TreeNode<T>): List<TreeNode<T>>?(source)

Returns the chain of nodes from descendant up to and including this node, or null if descendant is not a strict descendant of this node.

Return

the path [descendant, …, this], or null if descendant is the root or is not located in this node's subtree.

Parameters

descendant

the node to walk up from.