Hello everyone

Does anyone know how to make an algorithm that transforms a binary search tree into an AVL tree, and yes transforms it and not make another tree (so it will only be done using rotations) and not with the DSW technique... and in C.
So basically the hardest part is treating all the cases since there is 4 types of rotations.
Thank you so much if you help !!