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 ] ) : NEW_LINE INDENT u , v = v , u NEW_LINE DEDENT d = level [ v ] - level [ u ] NEW_LINE