Category: DFS
Given a binary tree, each node has value 0 or 1. Each root-to-leaf path represents a binary number starting with the most significant bit. For example, if the path …
The n queens puzzle asks to place n queens on an n×n chessboard so that no two queens are attacking each other. Given a partially filled two-dimensional integer matrix …
Teaching Kids Programming: Videos on Data Structures and Algorithms Given a binary tree root, return the number of unique vertical lines that can be drawn such that every node …
Given the root of an n-ary tree, return the preorder traversal of its nodes’ values. Nary-Tree input serialization is represented in their level order traversal. Each group of children …
Teaching Kids Programming: Videos on Data Structures and Algorithms Given a binary tree root, repeatedly delete all leaves that have even values. That is, if after deletions, a node …