Tag: dfs
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 …
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words. For example, given …
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. …