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

Method rightRotate

Ports/CLDC11/src/java/util/TreeMap.java:4761–4779  ·  view source on GitHub ↗
(Node<K, V> x)

Source from the content-addressed store, hash-verified

4759 }
4760
4761 private void rightRotate(Node<K, V> x) {
4762 Node<K, V> y = x.left;
4763 x.left = y.right;
4764 if (y.right != null) {
4765 y.right.parent = x;
4766 }
4767 y.parent = x.parent;
4768 if (x.parent == null) {
4769 root = y;
4770 } else {
4771 if (x == x.parent.right) {
4772 x.parent.right = y;
4773 } else {
4774 x.parent.left = y;
4775 }
4776 }
4777 y.right = x;
4778 x.parent = y;
4779 }
4780
4781 private void leftRotate(Node<K, V> x) {
4782 Node<K, V> y = x.right;

Callers 2

balanceMethod · 0.95
fixupMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected