【刷题】如何查找最长链
人数 行数
7 5
1->3
5->2
10->8
3->4
4->5
最长链是1->3->4->5->2
题目解析
透过现象看本质:就是list转成tree, 计算tree的最大深度
难点是 list转成tree如何动态添加节点
参考: https://blog.csdn.net/xcymorningsun/article/details/79254819
如果是tree, 要用多个tree, 有点难度
用多个list?
@@@build beautiful things, share happiness@@@