paint-brush
Learning to Code: Print Nodes at Distance K From Nodeby@learncodingwithme
1,899 reads
1,899 reads

Learning to Code: Print Nodes at Distance K From Node

by Akshay Sharma7mJune 3rd, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

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
Akshay Sharma

Akshay Sharma

@learncodingwithme

Tech Expert

Learn More
LEARN MORE ABOUT @LEARNCODINGWITHME'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Akshay Sharma HackerNoon profile picture
Akshay Sharma@learncodingwithme
Tech Expert

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite