From f65fe8c858636c0e7d29e7f9561d3109f984978b Mon Sep 17 00:00:00 2001 From: Rafael Date: Thu, 6 Jul 2017 21:13:56 +0200 Subject: [PATCH] more rotations --- data_structures/AVL/AVL.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/data_structures/AVL/AVL.py b/data_structures/AVL/AVL.py index ab09743ee..0e3008dc1 100644 --- a/data_structures/AVL/AVL.py +++ b/data_structures/AVL/AVL.py @@ -123,7 +123,9 @@ class AVL: node.getLeft().setHeight(node.getLeft().getHeight() - 1) def double_rotate_left(self, node): - pass + self.rotate_right(node.getRight().getRight()) + self.rotate_left(node) - def double_rotate_righs(self, node): - pass + def double_rotate_right(self, node): + self.rotate_left(node.getLeft().getLeft()) + self.rotate_right(node)