MCPcopy Create free account
hub / github.com/QMHTMY/RustBook / size

Method size

publication/code/chapter08/binary_tree.rs:70–72  ·  view source on GitHub ↗

计算节点数

(&self)

Source from the content-addressed store, hash-verified

68
69 // 计算节点数
70 fn size(&self) -> usize {
71 self.calc_size(0)
72 }
73
74 fn calc_size(&self, mut size: usize) -> usize {
75 size += 1;

Callers 3

none_leaf_sizeMethod · 0.45
levelorderMethod · 0.45
levelorderFunction · 0.45

Calls 1

calc_sizeMethod · 0.45

Tested by

no test coverage detected