subject

Balancing an AVL Tree In a previous POTD, we were able to identify the deepest nodes that were unbalanced in an AVL tree. Nowit is time for you to actually balance them!
Your task is to implement the following function
balanceTree(TreeNodex& subroot) Returns which rotation type to use
A RotationType, which is defined in the TreeNode. h is simply an enumeration, which can take on the values:
right
left
rightLeft
leftRight
You are given the following helper functions
leftHeavy(const TreeNode* subroot) Returns true iff the right subtree is higher
rightHeavy(const TreeNode* subroot) Returns true iff the left subtree is higher
getHeight (const TreeNodex subroot) Returns the height of the given subtree
printTreePre0rder(const TreeNode* subroot) Prints the tree in pre order traversal

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 06:30, gracie2492
What result from the passage of this amendment
Answers: 1
image
Computers and Technology, 23.06.2019 06:00, tchloe448
What makes myhexadecimalnumber a child of mynumber? which methods does myhexadecimalnumber inherit directly from the mynumber class? what can an instance of the mynumber class do? what can an instance of the myhexadecimalnumber class do? which methods are overridden? why are they overridden? how many examples of overloading are there? why was this done? where is the super keyword used? what is it doing? why isn’t the incoming value set immediately in the second myhexadecimalnumber constructor? how many examples can you find of an inherited method being called?
Answers: 1
image
Computers and Technology, 23.06.2019 17:30, kenyasutton10
What are the most commonly found items in the trash according to the municipal solid waste report?
Answers: 1
image
Computers and Technology, 24.06.2019 13:30, livie225
Type the correct answer in the box. spell all words correctly. what is the default margin width on all four sides of a document? by default, the document has a margin on all four sides.
Answers: 1
You know the right answer?
Balancing an AVL Tree In a previous POTD, we were able to identify the deepest nodes that were unba...

Questions in other subjects:

Konu
Mathematics, 05.11.2019 01:31