Wednesday, July 25, 2018

[LeetCode]Leaf-Similar Trees


递归收集两个数的叶子然后比较即可。时间复杂度O(m + n),m和n分别为两个树的size,代码如下:


No comments:

Post a Comment