TreeLeaves
TreeLeaves[tree]
returns the list of leaves of the tree tree.
Details
- TreeLeaves lists the subtrees {leaf1,leaf2,…} of a Tree object for which TreeLeafQ gives True.
- TreeLeaves[tree] is equivalent to TreeLevel[tree,{-1}].
Examples
open allclose allProperties & Relations (3)
TreeLeaves gives the subtrees at level -1:
TreeLeaves[tree] returns the list of subtrees for which TreeLeafQ gives True:
TreeLeafCount[tree] is equivalent to Length[TreeLeaves[tree]]:
Wolfram Research (2021), TreeLeaves, Wolfram Language function, https://reference.wolfram.com/language/ref/TreeLeaves.html (updated 2022).
Text
Wolfram Research (2021), TreeLeaves, Wolfram Language function, https://reference.wolfram.com/language/ref/TreeLeaves.html (updated 2022).
CMS
Wolfram Language. 2021. "TreeLeaves." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/TreeLeaves.html.
APA
Wolfram Language. (2021). TreeLeaves. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TreeLeaves.html