I've seen a bunch of stuff about AVL trees and how to rotate them, but it's not exactly what I'm looking for. I'm trying to rotate a binary search tree to the right (a diagram is included below). Like I have a specific node I want to rotate around and I'm confused on how to rotate to the right around it.
If I start with a function like void rotateRight(int key){}
, how would I use the value inside each of the nodes to then rotate the tree around it.
Aucun commentaire:
Enregistrer un commentaire