TreeLeafCount
TreeLeafCount[tree]
tree の葉の数を与える.
例題
すべて開くすべて閉じる特性と関係 (8)
TreeLeafCount[tree]はLength[TreeSelect[tree,TreeLeafQ]]に等しい:
TreeLeafCount[tree]はLength[TreeLeaves[tree]]に等しい:
TreeLeafCount[tree]はTreeCount[tree,_,{-1}]に等しい:
TreeLeafCount[Tree[{tree1,tree2,…}]]はTreeLeafCount[tree1]+TreeLeafCount[tree2]+…を与える:
TreeLeafCount[Tree[data,None]]は1を与える:
TreeLeafCount[Tree[data,{}]]は0を与える:
TreeSize[Tree[data,{}]]は1を与える.
TreeLeafCountはTreeFoldを使って計算できる:
LeafCount[expr]は,一般に,TreeLeafCount[ExpressionTree[expr,HeadsTrue]]に等しい:
LeafCount[expr,HeadsFalse]は,一般に,TreeLeafCount[ExpressionTree[expr,"Subexpressions"]]に等しい:
テキスト
Wolfram Research (2022), TreeLeafCount, Wolfram言語関数, https://reference.wolfram.com/language/ref/TreeLeafCount.html.
CMS
Wolfram Language. 2022. "TreeLeafCount." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TreeLeafCount.html.
APA
Wolfram Language. (2022). TreeLeafCount. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TreeLeafCount.html