MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / rlrotation

Function rlrotation

data_structures/binary tree/AVLtree.py:103–115  ·  view source on GitHub ↗

r''' A A Br / \ / \ / \ B C RR Br C LR B A / \ --> / \ --> / / \ Bl Br B UB Bl UB C \

(node)

Source from the content-addressed store, hash-verified

101 return ret
102
103def rlrotation(node):
104 r'''
105 A A Br
106 / \ / \ / \
107 B C RR Br C LR B A
108 / \ --> / \ --> / / \
109 Bl Br B UB Bl UB C
110 \ /
111 UB Bl
112 RR = rightrotation LR = leftrotation
113 '''
114 node.setleft(rightrotation(node.getleft()))
115 return leftrotation(node)
116
117def lrrotation(node):
118 node.setright(leftrotation(node.getright()))

Callers 2

insert_nodeFunction · 0.85
del_nodeFunction · 0.85

Calls 4

rightrotationFunction · 0.85
leftrotationFunction · 0.85
setleftMethod · 0.80
getleftMethod · 0.80

Tested by

no test coverage detected