Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QMHTMY/RustBook
/ none_leaf_size
Method
none_leaf_size
publication/code/chapter08/binary_tree.rs:109–111 ·
view source on GitHub ↗
计算非叶节点数 [千万不要想复杂了]
(&self)
Source
from the content-addressed store, hash-verified
107
108
// 计算非叶节点数 [千万不要想复杂了]
109
fn none_leaf_size(&self) -> usize {
110
self.size() - self.leaf_size()
111
}
112
113
// 计算树深度
114
fn depth(&self) -> usize {
Callers
nothing calls this directly
Calls
2
size
Method · 0.45
leaf_size
Method · 0.45
Tested by
no test coverage detected