LeetCode知识点总结 – 872

LeetCode 872. Leaf-Similar Trees
考点难度TreeEasy
题目
Consider all the leaves of a binary tree, from left to right order, the values of those leaves form a leaf value sequence. Two binary trees are considered leaf-similar if their leaf value sequence is the same. Return true if and only if the two given trees with head nodes root1 and root2 are leaf-similar.
思路
用depth first search算出来leaf,之后比较。
答案
class Solut

LeetCode知识点总结 – 872最先出现在Python成神之路

版权声明:
作者:ht
链接:https://www.techfm.club/p/11870.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>