Report Each Binary-Tree Node's Level and Balance Status
Given the root of a binary tree, use DFS to report the following information for every node:
- The node value;
- Its depth
level, where the root is at level0; - Whether the node is balanc...
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Standard Input
Execution Result:
