My Blog List

[Leetcode Solution]Balanced Binary Tree

Analysis

  • Using BFS search each layer of binary tree from the root to leaf and find out the maximum depth and minimum depth
  • If the difference between two depths is bigger then 1 then return false, else return true

Note

Code


No comments:

Post a Comment

Enter you comment