Modify the author's BinarySearchTree code to implement some new methods as shown below.
a) rotateRight
Performs a single rotation on the node having the passed value.
Example:
If a RotateRight on 100 is performed:
100 50
/ /
50 150 --> 40 100
/
40 45 150
45
b) rotateLeft
Similar to above but instead a left rotation.
c) copy
Creates and returns a new tree that is a copy of the original tree.
Get Free Quote!
280 Experts Online