parent should remain an ancestor of all of its descendants //and tops location in the tree should be replaced by top-right void rotateLeft (AVLNodetop) void rotateRight (AVLNode top) t1 Implementation not shown / (a) (10 points – Correctness) Implement rotateLeft in either psuedocode or C++ (not English):” src=”https://files.transtutors.com/cdn/qimg/033dbd971f5643abbb393ad871b04e7b.jpg” aria-describedby=”gg0″>

2. (15 points – Correctness) Suppose you’ve been given the following code: class AVLNode i public: AVLNodeleft, right, parent: int value; int height: // root node stores tree height: a single node tree has height1 //Rotate left e top //E.g. top->parent should remain an ancestor of all of its descendants //and top’s location in the tree should be replaced by top-right void rotateLeft (AVLNodetop) void rotateRight (AVLNode top) t1 Implementation not shown / (a) (10 points – Correctness) Implement rotateLeft in either psuedocode or C++ (not English):



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *