Tag: dfs
Numbers can be regarded as product of its factors. For example, 8 = 2 x 2 x 2; = 2 x 4. Write a function that takes an integer …
Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the candidate numbers sums to target. The same …
Given a binary tree, collect a tree’s nodes as if you were doing this: Collect and remove all leaves, repeat until the tree is empty. Example: Input: 1 / …
Given the root node of a binary search tree, return the sum of values of all nodes with value between L and R (inclusive). The binary search tree is …
Given a binary search tree and a target, find out if there are any two numbers in the BST that sums up to this target. Given a Binary Search …