DIY: All Nodes Distance K in Binary Tree
We'll cover the following
Problem statement
We are given a binary tree (with a root node root
), a target
node, and an integer value, K
.
Return a list of the values of all nodes that are K
distance from the target
node.
Input
The following is ...
Create a free account to view this lesson.
Continue your learning journey with a 14-day free trial.
By signing up, you agree to Devpath's Terms of Service and Privacy Policy