摘要: 1.对称二叉树 题目链接:https://leetcode-cn.com/problems/symmetric-tree/ 题目描述: 题解: class Solution { public: bool check(TreeNode *p, TreeNode *q) { if (p == NULL 阅读全文
posted @ 2021-02-06 17:01 张宵 阅读(83) 评论(0) 推荐(0)
摘要: 题目链接:https://leetcode-cn.com/problems/find-bottom-left-tree-value/ 题目描述:给定一个二叉树,在树的最后一行找到最左边的值。 题解: 层序遍历,每次遇到当前层的第一个元素记录,遍历到最后一层时,即找到了左下角的值。 /** * Def 阅读全文
posted @ 2021-02-06 16:46 张宵 阅读(99) 评论(0) 推荐(0)