Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/algorithmzuo/algorithm-journey
/ rank
Method
rank
src/class148/Code01_AVL1.java:179–181 ·
view source on GitHub ↗
(int num)
Source
from the content-addressed store, hash-verified
177
178
// 查询num的排名,比num小的数字个数+1,就是num的排名
179
public
static
int
rank(
int
num) {
180
return
small(head, num) + 1;
181
}
182
183
// 以i为头的树上,比num小的数字有几个
184
public
static
int
small(
int
i,
int
num) {
Callers
2
remove
Method · 0.95
main
Method · 0.95
Calls
1
small
Method · 0.95
Tested by
no test coverage detected