avinash201199 / avinash201199/DSA-Questions

Diameter of Binary tree [JAVA]

Open
#224 0 comments 1 reaction 1 assignee Claimed by @ishika22 View on GitHub
hacktoberfest
Dominant language
C++
Stars
88
Forks
167
PR merge metrics
No merged PRs in 30d

Description

**Problem Description**
To find diameter of the binary tree in O(n) time complexity. The diameter of a tree is the number of nodes on the longest path between two end nodes.
**Proposed Solution**
Maintaining a class variable to finding the height of each node rather than recursively finding it every time.

@avinash201199 can you please assign this issue to me.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.