Tag: depth first search algorithm
You are given two binary search trees a and b and an integer target. Return whether there’s a number in a and a number in b such that their …
Teaching Kids Programming: Videos on Data Structures and Algorithms Yesterday, we talked about the Breadth First Search Algorithm. We are solving the same Jump Game problem today by using …
Given a binary tree root, count and return the number of nodes where its value is greater than or equal to the values of all of its descendants. For …
Given a binary tree root, return the largest absolute difference between any node and its descendants. For example, given the following tree: 0 / \ 4 2 / \ …
Given a binary tree root, return whether for every node in the tree other than leaves, its value is equal to the sum of its left child’s value and …