The node which is present farthest from the root node is taken as v If u is farther from root node then swap the two
if ( level [ u ] > level [ v ] ) swap ( u , v ) ; int d = level [ v ] - level [ u ] ;