List => 1 2 3 4 5 6 7 8 9
N=3 Out Put => 1 2 3 6 5 4 7 8 9 N=4 Out Put => 1 2 6 5 4 3 7 8 9 N=5 Out Put => 1 2 7 6 5 4 3 8 9
List => 1 ---> 2 ---> 3 ---> 4 ---> 5 ---> 6 / \ 10 7 \ / 9 <--- 8 OURTPUT => 1 ---> 2 ---> 3 ---> 4 ---> 10 ---> 9 / \ 5 8 \ / 6 <--- 7
Given two n-node trees, how many rotations does it take to convert one tree into the other?