AlgoMaster Logo

All Nodes Distance K in Binary Tree

tree=[3, 5, 1, 6, 2, 0, 8, null, null, 7, 4],target=5,k=2
0 / 34
algomaster.io
Step:Find every node at distance 2 from the target node 5