今際の国の呵呵君
Wednesday, May 9, 2018
[LeetCode]Diameter of Binary Tree
找二叉树直径的问题,等价于找无向无环图直径的问题,等价于找无向无环图最长路径的问题。递归的方法,很简单就不多说了。时间复杂度O(n),代码如下:
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment