Tag: binary tree algorithms
You are given a binary tree root containing unique values, and an integer target. Find the node with value target and return the node that’s directly right of it …
Given a binary tree root, remove all nodes with only one child. Constraints n ≤ 100,000 where n is the number of nodes in root Example 1 Input root …
Given a binary tree, return the sum of values of its deepest leaves. Example 1: Input: root = Output: 15 Constraints: The number of nodes in the tree is …
Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a binary tree in which the depth of the two …
Given the root of a binary tree, find the maximum value V for which there exists different nodes A and B where V = |A.val – B.val| and A …