0

https://youtu.be/G5QIXywcJlY?t=31m47s

At 31:47, I believe he performs a double right rotation with 5 being the grandparent, and 4 being the parent, and 1 being the child. After the double right rotation, he has 4 as the right child of 5.

enter image description here

Tommy Saechao
  • 1,099
  • 4
  • 17
  • 28

1 Answers1

0

No it is not. He first performs a RR pivot so that the 1 has the 2 and the 3 off to its right. He then performs the same RR pivot but this time 1 has a right child so that right child has to be put somewhere so that 5-4 can become the new right child. The solution is to make 5-4 the new right child and then put the old right child to the left of the 5.

Jay
  • 157
  • 2
  • 11