(Entry<K, V> x)
| 4377 | } |
| 4378 | |
| 4379 | static <K, V> Entry<K, V> predecessor(Entry<K, V> x) { |
| 4380 | if (x.left != null) { |
| 4381 | return maximum(x.left); |
| 4382 | } |
| 4383 | Entry<K, V> y = x.parent; |
| 4384 | while (y != null && x == y.left) { |
| 4385 | x = y; |
| 4386 | y = y.parent; |
| 4387 | } |
| 4388 | return y; |
| 4389 | } |
| 4390 | |
| 4391 | static private <K, V> Node<K, V> successor(Node<K, V> x) { |
| 4392 | if (x.right != null) { |