摘要: 仅供自己学习 题目: You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the foll 阅读全文
posted @ 2021-02-03 21:42 Mrsdwang 阅读(65) 评论(0) 推荐(0)
摘要: 仅供自己学习 题目: Invert a binary tree. Example: Input: 4 / \ 2 7 / \ / \1 3 6 9Output: 4 / \ 7 2 / \ / \9 6 3 1 思路: 这就是直接交换数据就可以了,可以前序遍历,后序遍历,中序遍历的交换 代码: 前序 阅读全文
posted @ 2021-02-03 12:03 Mrsdwang 阅读(46) 评论(0) 推荐(0)
摘要: 仅供自己学习 题目: Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. You may return the answer in any order. Example 1 阅读全文
posted @ 2021-02-03 11:07 Mrsdwang 阅读(56) 评论(0) 推荐(0)