MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / rightRotate

Method rightRotate

vm/JavaAPI/src/java/util/TreeMap.java:4739–4757  ·  view source on GitHub ↗
(Node<K, V> x)

Source from the content-addressed store, hash-verified

4737 }
4738
4739 private void rightRotate(Node<K, V> x) {
4740 Node<K, V> y = x.left;
4741 x.left = y.right;
4742 if (y.right != null) {
4743 y.right.parent = x;
4744 }
4745 y.parent = x.parent;
4746 if (x.parent == null) {
4747 root = y;
4748 } else {
4749 if (x == x.parent.right) {
4750 x.parent.right = y;
4751 } else {
4752 x.parent.left = y;
4753 }
4754 }
4755 y.right = x;
4756 x.parent = y;
4757 }
4758
4759 private void leftRotate(Node<K, V> x) {
4760 Node<K, V> y = x.right;

Callers 2

balanceMethod · 0.95
fixupMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected