leetcode-863-All Nodes Distance K in Binary Tree

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zem_nezer/article/details/86619961

Convert tree to indirect graph, then use BFS to get K distance from target.

Error:

  1. Do not fully understand the BFS, when wants to get smallest distance, or K distance, it is very useful to think about it.

猜你喜欢

转载自blog.csdn.net/zem_nezer/article/details/86619961