Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/algorithmzuo/algorithm-journey
/ rank
Method
rank
src/class152/FollowUp1.java:86–91 ·
view source on GitHub ↗
(int num)
Source
from the content-addressed store, hash-verified
84
}
85
86
public
static
int
rank(
int
num) {
87
split(0, 0, head, num - 1);
88
int
ans = size[right[0]] + 1;
89
head = merge(right[0], left[0]);
90
return
ans;
91
}
92
93
public
static
int
index(
int
i,
int
x) {
94
if
(size[left[i]] >= x) {
Callers
1
main
Method · 0.95
Calls
2
split
Method · 0.95
merge
Method · 0.95
Tested by
no test coverage detected