Tag: bfs
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 binary tree, compute the average values for the nodes on each level and return them in the form of an array. For example: Input: 3 / \ …
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. …