MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / rl_rotation

Function rl_rotation

data_structures/binary_tree/avl_tree.py:143–147  ·  view source on GitHub ↗
(node: MyNode)

Source from the content-addressed store, hash-verified

141
142
143def rl_rotation(node: MyNode) -> MyNode:
144 right_child = node.get_right()
145 assert right_child is not None
146 node.set_right(right_rotation(right_child))
147 return left_rotation(node)
148
149
150def insert_node(node: MyNode | None, data: Any) -> MyNode | None:

Callers 2

insert_nodeFunction · 0.85
del_nodeFunction · 0.85

Calls 4

right_rotationFunction · 0.85
left_rotationFunction · 0.85
get_rightMethod · 0.80
set_rightMethod · 0.80

Tested by

no test coverage detected