Tag: breadth first search
Given a binary tree root, return whether all leaves are at the same level. Constraints n ≤ 100,000 where n is the number of nodes in root Breadth First …
Teaching Kids Programming: Videos on Data Structures and Algorithms Given a Binary Tree, we can visit the nodes in a particular order – which is called Tree Traversal. Binary …
In a binary tree, a lonely node is a node that is the only child of its parent node. The root of the tree is not lonely because it …
Given a binary tree, return the sum of values of its deepest leaves. Example 1: Input: root = Output: 15 Constraints: The number of nodes in the tree is …
Given a binary tree, return the zigzag level order traversal of its nodes’ values. (ie, from left to right, then right to left for the next level and alternate …