DIY: All Nodes Distance K in Binary Tree
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.
By signing up, you agree to Educative's Terms of Service and Privacy Policy