DFS from X ( other end of diameter ) and check the farthest node ( s ) from it
dfs ( X , - 1 , 0 , 1 , adj ) NEW_LINE def printDiameters ( adj ) : NEW_LINE global diameter NEW_LINE dfsUtility ( adj ) NEW_LINE for i in range ( 1 , 6 + 1 ) : NEW_LINE