(int i, int x)
| 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); |