(TreeNode root)
| 1 | class Solution { |
| 2 | int maxi=0; |
| 3 | public int diameterOfBinaryTree(TreeNode root) { |
| 4 | |
| 5 | if(root == null) return 0; |
| 6 | int ans[]=new int[1]; |
| 7 | findDiameter(root,ans); |
| 8 | return ans[0]; |
| 9 | |
| 10 | } |
| 11 | public int findDiameter(TreeNode root, int maxi[]) |
| 12 | { |
| 13 | if(root == null) return 0; |
nothing calls this directly
no test coverage detected