gb_trees:size/1
返回树的节点数量
用法:
size(Tree) -> integer() >= 0
内部实现:
-spec size(Tree) -> non_neg_integer() when Tree :: gb_tree(). size({Size, _}) when is_integer(Size), Size >= 0 -> Size.
返回树的节点数量。
Orddict = orddict:from_list([{pear, 7}, {orange, 5}, {apple, 2}]), Tree = gb_trees:from_orddict(Orddict), gb_trees:size(Tree).