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 temp = u NEW_LINE u = v NEW_LINE v = temp NEW_LINE DEDENT