Question

Show that any arbitrary n-node binary search tree can be transformed into any other arbitrary n-node binary search tree using O (n) rotations. (Hint: First show that at most n - 1 right rotation suffices to transform the tree into a right-going chain.)