Learning to Code: Print Nodes at Distance K From Nodeby@learncodingwithme
940 reads

Learning to Code: Print Nodes at Distance K From Node

tldt arrow
Read on Terminal Reader🖨️

Too Long; Didn't Read

We have an arbitrary binary tree, a node of that tree, and also an integer: 'K.' We need to print all such nodes which have a distance K from the given node and return the list of these nodes. You can check out this problem here as well: Print Nodes at Distance k from Node. The distance between the two nodes in a binary tree is defined as the number of connections/edges in the path between the two nodes.

Company Mentioned

Mention Thumbnail
featured image - Learning to Code: Print Nodes at Distance K From Node
Akshay Sharma HackerNoon profile picture

@learncodingwithme

Akshay Sharma

Learn More
LEARN MORE ABOUT @LEARNCODINGWITHME'S EXPERTISE AND PLACE ON THE INTERNET.
react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa