MCPcopy Create free account
hub / github.com/davidgiven/luje / rightRotate

Method rightRotate

lib/java/util/TreeMap.java:1769–1787  ·  view source on GitHub ↗
(Node<K, V> x)

Source from the content-addressed store, hash-verified

1767 }
1768
1769 private void rightRotate(Node<K, V> x) {
1770 Node<K, V> y = x.left;
1771 x.left = y.right;
1772 if (y.right != null) {
1773 y.right.parent = x;
1774 }
1775 y.parent = x.parent;
1776 if (x.parent == null) {
1777 root = y;
1778 } else {
1779 if (x == x.parent.right) {
1780 x.parent.right = y;
1781 } else {
1782 x.parent.left = y;
1783 }
1784 }
1785 y.right = x;
1786 x.parent = y;
1787 }
1788
1789
1790 private void leftRotate(Node<K, V> x) {

Callers 2

balanceMethod · 0.95
fixupMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected