Code in java please, thank you
All the previous answers for this question are wrong please justdont copy and paste them. Thank you.
Create the following methods in java:
leftRotate(Node n) : performs a single left rotation on thespecified Node
fullLeft(Node n): performs a full left rotation on the specifiedNode
rightRotate(Node n) : performs a single right rotation on thespecified Node
fullRight(Node n): performs a full right rotation on thespecifid Node
int balance() : returns whether a tree is balanced or not. If itis balanced, it returns a 0. If the left subtree is unbalanced, itreturns a negative value, and the actual value will be the nodenumber (counting from the root) of the unbalanced node. If theright subtree is unbalanced, it returns a positive value,calculated the same way.
Code in java please, thank you All the previous answers for this question are wrong please just dont copy and paste them
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am