Returns the last key in this map. @return the last key in this map. @throws NoSuchElementException if this map is empty.
()
| 4339 | * if this map is empty. |
| 4340 | */ |
| 4341 | public K lastKey() { |
| 4342 | if (root != null) { |
| 4343 | Node<K, V> node = maximum(root); |
| 4344 | return node.keys[node.right_idx]; |
| 4345 | } |
| 4346 | throw new NoSuchElementException(); |
| 4347 | } |
| 4348 | |
| 4349 | static <K, V> Entry<K, V> maximum(Entry<K, V> x) { |
| 4350 | while (x.right != null) { |