powered by
treeListDepth() returns the depth of a nested list. For a derivation tree, this is approximately twice the derivation depth.
treeListDepth()
treeListDepth(t, tDepth = 0)
Depth of a nested list.
List.
Integer. List depth. Default: 0.
Other Measures of Tree Attributes: treeLeaves(), treeNodes(), treeProbability(), treeSize()
treeLeaves()
treeNodes()
treeProbability()
treeSize()
g<-compileBNF(booleanGrammar()) a<-randomDerivationTree(g$Start, g) treeListDepth(a)
Run the code above in your browser using DataLab