MCPcopy Create free account
hub / github.com/algorithmzuo/algorithm-journey / index

Method index

src/class151/Code02_Treap1.java:117–124  ·  view source on GitHub ↗
(int i, int x)

Source from the content-addressed store, hash-verified

115 }
116
117 public static int index(int i, int x) {
118 if (size[left[i]] >= x) {
119 return index(left[i], x);
120 } else if (size[left[i]] + count[i] < x) {
121 return index(right[i], x - size[left[i]] - count[i]);
122 }
123 return key[i];
124 }
125
126 public static int index(int x) {
127 return index(head, x);

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected