版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zem_nezer/article/details/86619961
Convert tree to indirect graph, then use BFS to get K distance from target.
Error:
- Do not fully understand the BFS, when wants to get smallest distance, or K distance, it is very useful to think about it.