(Node<K, V> x)
| 4757 | } |
| 4758 | |
| 4759 | private void leftRotate(Node<K, V> x) { |
| 4760 | Node<K, V> y = x.right; |
| 4761 | x.right = y.left; |
| 4762 | if (y.left != null) { |
| 4763 | y.left.parent = x; |
| 4764 | } |
| 4765 | y.parent = x.parent; |
| 4766 | if (x.parent == null) { |
| 4767 | root = y; |
| 4768 | } else { |
| 4769 | if (x == x.parent.left) { |
| 4770 | x.parent.left = y; |
| 4771 | } else { |
| 4772 | x.parent.right = y; |
| 4773 | } |
| 4774 | } |
| 4775 | y.left = x; |
| 4776 | x.parent = y; |
| 4777 | } |
| 4778 | |
| 4779 | /** |
| 4780 | * Copies all the mappings in the given map to this map. These mappings will |