Given two n-node trees, how many rotations does it take to convert one tree into the other?
Convert the given string into palindrome with minimum number of appends(at end of the given string). O(n) algorithm will be appreciated ??
Input :=> Malayal Output :=> Malayalam
Print cousins of a given node (Not sibling) ??
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