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/avl.rs:111–113 ·
view source on GitHub ↗
计算非叶节点数
(&self)
Source
from the content-addressed store, hash-verified
109
110
// 计算非叶节点数
111
fn none_leaf_size(&self) -> usize {
112
self.size() - self.leaf_size()
113
}
114
115
// 树深度是左右子树深度最大值 + 1,递归计算
116
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