@@ -0,0 +1,577 @@
+public class _0543DiameterOfBinaryTree %7B%0A  int max;%0A%0A  public int diameterOfBinaryTree(TreeNode root) %7B%0A    if (root == null) %7B%0A      return 0;%0A    %7D%0A    maxDiameter(root);%0A    return max;%0A  %7D%0A%0A  private int maxDiameter(TreeNode node) %7B%0A    int left = node.left == null ? 0 : maxDiameter(node.left) + 1;%0A    int right = node.right == null ? 0 : maxDiameter(node.right) + 1;%0A    max = Math.max(max, left + right);%0A    return Math.max(left, right);%0A  %7D%0A%0A  public class TreeNode %7B%0A      int val;%0A      TreeNode left;%0A      TreeNode right;%0A      TreeNode(int x) %7B val = x; %7D%0A  %7D%0A%7D%0A

Add _0543DiameterOfBinaryTree