...

LeetCode 110: Balanced Binary Tree

leetcode_solution

Problem statement Given the root of a binary tree, determine whether it is height-balanced. A binary tree is balanced if for every node: Formally, for each node:∣height(left)−height(right)∣≤1|height(left) – height(right)| \le 1∣height(left)−height(right)∣≤1 If this condition holds for all nodes, return true, otherwise return false. Why this problem is tricky Many people correctly check the height difference … Read more

Categories Uncategorized
Seraphinite AcceleratorOptimized by Seraphinite Accelerator
Turns on site high speed to be attractive for people and search engines.