Tag: depth first search algorithm
You have a set of tiles, where each tile has one letter tiles printed on it. Return the number of possible non-empty sequences of letters you can make. Example …
Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in (R >= L). You …
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 a binary tree, count the number of uni-value subtrees. A Uni-value subtree means all nodes of the subtree have the same value. Example : Input: root = 5 …
Given a reference of a node in a connected undirected graph, return a deep copy (clone) of the graph. Each node in the graph contains a val (int) and …