Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/douchuan/algorithm
/ bst_tree_height
Function
bst_tree_height
tests/test_bst_tree.rs:78–85 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
76
77
#[test]
78
fn bst_tree_height() {
79
// 升序数列,使BST退化成一个linked list
80
let mut tree = Tree::default();
81
for v in 0..100 {
82
tree.insert(v, v);
83
}
84
assert_eq!(tree.height(), 100);
85
}
86
87
#[test]
88
fn is_bst() {
Callers
nothing calls this directly
Calls
1
insert
Method · 0.45
Tested by
no test coverage detected