Tag: recursion
Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: 1 / \ 2 3 \ 5 All root-to-leaf paths are: Almost every tree …
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. …
Given a binary tree root, return whether it’s a binary search tree. A binary tree node is a binary search tree if : All nodes on its left subtree …
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 …
A Binary Search Tree (BST) is a binary tree that satisfies the following requirements: The value of a parent node is bigger than all values of its left sub …