刷 LeetCode 的时候碰到了一道题——LeetCode 94 二叉树的中序遍历,学会了一种有趣的非递归二叉树遍历方法,特此记录。 算法目标尝试使用空间复杂度 O(1) 的
本题是经典的快速幂问题,要熟悉解题算法的思想,方便以之位原型和模板处理更复杂的问题。 题目描述原题链接如下: LeetCode 50 Pow(x, n) 题目大意用尽量快的办法求出
本题是一道非常典型的算法题,虽然本身难度不高,但是非常有助于理解递归程序的特点,值得牢固掌握。 题目描述原题链接如下: LeetCode 236 二叉树的最近公共祖先
本题是一道常见的动态规划题目,关键点在于子问题状态的定义。 题目描述原题链接如下: LeetCode 221 最大正方形 题目大意本题中矩阵只包含 0 或者 1,而且对最大正
本题属于典型的动态规划题目,而且还有不止一种做法,又能与贪心算法有所联系,算是一道比较优秀的题目。 题目描述原题链接如下: LeetCode 983 最低票价 题目大意