Tag: recursive dfs
Teaching Kids Programming: Videos on Data Structures and Algorithms Given the root node of a binary search tree, return the sum of values of all nodes with a value …
Teaching Kids Programming: Videos on Data Structures and Algorithms Given a binary tree root, return the number of nodes that are an only child. A node x is an …
Write a method to return all subsets of a set. The elements in a set are pairwise distinct. Note: The result set should not contain duplicated subsets. Example: Input: nums …
Teaching Kids Programming: Videos on Data Structures and Algorithms Given a binary tree root, return whether all leaves are at the same level. Constraints n ≤ 100,000 where n …
Given a binary tree root, repeatedly delete all leaves that have even values. That is, if after deletions, a node becomes a leaf with an even value, it too …