题目描述: 题解:首先要了解卡特兰数的递归公式。对于序列[1,2,....n]构成的二叉搜索树,我们按顺序选择i作为根节点,[1,..i-1]构成左子树,[i+1,....n]作为右子树。递归的重复上述操作即可 (之前写树的题返回值都是单个值,这里递归返回值为节点序列,因为有很多种情况) AC代码: ...
分类:
其他好文 时间:
2020-02-13 17:17:18
阅读次数:
68
ALGOLTEKAG6202是一个高性能、低成本的单片机解决方案,用于实现HDMI1.4高分辨率视频转VGA转换器。采用ALGOLTEK’salgoltek超低功耗设计,AG6202无需外部电源即可独立运行。II.AG6202特性AG6202支持1920x1200@60Hz的视频分辨率支持热插拔检测无晶体,片上集成晶体AG6202内置3.3vand1.2V电压调节器芯片HDCP引擎,符合HDCP1
分类:
其他好文 时间:
2020-02-12 10:47:03
阅读次数:
87
LeetCode 0167: Two Sum II Input array is sorted【Python】 题目 "英文题目链接" Given an array of integers that is already sorted in ascending order\ , find two n ...
分类:
编程语言 时间:
2020-02-12 00:19:27
阅读次数:
74
遇到个不会的 Effective triangulation Tiling and rasterization both work on fragment patches larger than a single pixel; e.g. for Mali GPUs the tiling will u ...
分类:
其他好文 时间:
2020-02-11 20:52:47
阅读次数:
92
题目地址 链表部分反转 憨比解法,找到反转段的pre,反转中间段的同时记录尾节点,再接上后面一段 优秀解法,中间段的反转用头插法的思路 注意用个dummy头结点会比较方便处理边界 code1 code2 ...
分类:
其他好文 时间:
2020-02-11 19:30:21
阅读次数:
75
二叉树层序遍历二。题意跟版本一很接近,唯一的不同点是输出的output需要从下往上排列,叶子节点层最先输出,根节点在最后输出。例子, For example:Given binary tree [3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7 return i ...
分类:
其他好文 时间:
2020-02-11 09:30:26
阅读次数:
53
题目 :https://leetcode cn.com/problems/unique binary search trees ii/ 给定一个整数 n,生成所有由 1 ... n 为节点所组成的二叉搜索树。 思路 :还是要从递归的角度去思考,策略是,从1 n中选择i作为根节点,那么1 i 1作为它 ...
分类:
其他好文 时间:
2020-02-11 00:19:24
阅读次数:
62
Problem : Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, gi ...
分类:
其他好文 时间:
2020-02-10 00:20:24
阅读次数:
81
1. 112题 题目地址:https://leetcode-cn.com/problems/path-sum/description/ 题目描述:给定一个二叉树和一个目标和,判断该树中是否存在根节点到叶子节点的路径,这条路径上所有节点值相加等于目标和。 解决方案: 递归判断 2. (二)113题 题 ...
分类:
其他好文 时间:
2020-02-10 00:09:15
阅读次数:
71
题意:对于一个有序数组,输出和为target的两个元素的下标。题目保证仅有唯一解。 分析: 法一:二分。枚举第一个元素,二分找另一个元素,时间复杂度O(nlogn),非最优解。 class Solution { public: vector<int> twoSum(vector<int>& numb ...
分类:
其他好文 时间:
2020-02-09 22:14:01
阅读次数:
73