算法总结
鲤吻
取乎其上,得乎其中;取乎其中,得乎其下;取乎其下,则无所得矣
展开
-
算法总结 - 字符串 - 字符压缩与延伸
算法总结 - 字符串 - 字符压缩与延伸809. Expressive Words809. Expressive WordsSometimes people repeat letters to represent extra feeling, such as “hello” -> “heeellooo”, “hi” -> “hiiii”. In these strings lik...原创 2020-05-04 11:55:59 · 311 阅读 · 0 评论 -
算法总结 - 字符串 - 字符转换
算法总结 - 字符串 - 字符转换1153. String Transforms Into Another String833. Find And Replace in String1153. String Transforms Into Another String题目链接Given two strings str1 and str2 of the same length, determi...原创 2020-05-04 10:50:58 · 296 阅读 · 0 评论 -
翻转数字题目总结
翻转数字题目总结246. Strobogrammatic Number247. Strobogrammatic Number II248. Strobogrammatic Number III1056. Confusing Number1088. Confusing Number II246. Strobogrammatic Number题目链接A strobogrammatic numbe...原创 2020-05-03 13:21:46 · 840 阅读 · 0 评论 -
算法总结 - 数组 -贪心算法
数组-贪心算法1007. Minimum Domino Rotations For Equal Row1007. Minimum Domino Rotations For Equal Row题目链接In a row of dominoes, A[i] and B[i] represent the top and bottom halves of the i-th domino. (A do...原创 2020-05-01 14:09:48 · 344 阅读 · 0 评论 -
启发式算法
启发式算法 Heuristic843. Guess the Word843. Guess the Word题目链接This problem is an interactive problem new to the LeetCode platform.We are given a word list of unique words, each word is 6 letters long, ...原创 2020-05-01 14:09:19 · 284 阅读 · 0 评论 -
滑动窗口问题
最小窗口问题727. Minimum Window Subsequence76. Minimum Window Substring727. Minimum Window Subsequence题目链接Given strings S and T, find the minimum (contiguous) substring W of S, so that T is a subsequence...原创 2020-04-17 04:18:22 · 153 阅读 · 0 评论 -
博弈问题
博弈问题486. Predict the Winner1140. Stone Game II1406. Stone Game III486. Predict the Winner题目链接Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either e...原创 2020-04-16 14:34:04 · 214 阅读 · 0 评论 -
房屋抢劫问题
House Robber 房屋抢劫198. House Robber213. House Robber II337. House Robber III198. House Robber题目链接You are a professional robber planning to rob houses along a street. Each house has a certain amount ...原创 2020-04-16 02:04:19 · 331 阅读 · 0 评论 -
算法总结 - 数组 - 排列组合
Array排列组合排列组合排列组合是数组类型题目中的常考题。31. Next PermutationImplement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not p...原创 2020-03-09 03:20:37 · 1168 阅读 · 0 评论 -
算法总结 - 树 - 生成与变形
Tree树的生成与变形1. 树的生成1.1 根据遍历建树1.2 根据字符串建树1.3 根据数组建树2. 树的变形树的生成与变形1. 树的生成1.1 根据遍历建树106. Construct Binary Tree from Inorder and Postorder TraversalGiven inorder and postorder traversal of a tree, con...原创 2019-07-28 12:33:52 · 535 阅读 · 0 评论 -
算法总结 - 树 - 递归
TreeRecursion (递归)Recursion (递归)原创 2019-07-22 09:53:33 · 253 阅读 · 0 评论 -
算法总结 - 树 - 路径和距离
TreePath Sum and Distance(路径和距离)1. 从根节点到子节点的路径等于给定路径和 - 检查存在2. 从根节点到子节点的路径等于给定路径和 - 打印所有符合要求路径3. 从根节点到子节点的路径等于给定路径和 - 树用字符串表示4. 任意节点到任意节点路径等于给定路径和 - 所有符合要求路径的个数5. 任意节点到任意节点路径等于给定路径和 - 最长路径6. 任意节点到任意节点...原创 2019-07-21 13:52:31 · 1331 阅读 · 1 评论 -
算法总结 - 树 - 序列化
TreeSerilization(序列化)1. 二叉树的序列化1.1 普通二叉树序列化1.2 搜索二叉树序列化2. 多叉树的序列化3.序列化检查Serilization(序列化)1. 二叉树的序列化1.1 普通二叉树序列化297. Serialize and Deserialize Binary TreeSerialization is the process of converti...原创 2019-07-21 03:40:26 · 481 阅读 · 0 评论 -
算法总结 - 树 - 遍历 - 常见算法题类型
TreeTraversal (遍历)a. In order traversal(中序遍历)1. 直接的递归方式省略2. 使用栈进行迭代3. 使用Morris遍历b. Preorder traversal(先序遍历)1. 递归2. 使用栈进行迭代b. Postorder traversal(后序遍历)1. 递归2. 使用栈进行迭代Traversal (遍历)a. In order trav...原创 2019-07-21 03:42:04 · 299 阅读 · 0 评论 -
算法总结 - 树 - 传值
Tree传值传值这种题型算是树中比较难的类型,因为可能涉及到传递不同的值来决定最终的返回值。首先确定用什么结构,用什么方式传递值是需要仔细考虑的,另外在收集到信息后如何整合贡献到最终结果的过程也可能涉及到复杂的逻辑。333. Largest BST SubtreeGiven a binary tree, find the largest subtree which is a Binary...原创 2019-07-29 13:44:35 · 360 阅读 · 0 评论 -
算法总结 - 树 - 遍历 - 基本遍历类型
TreeTraversal(遍历)1. 基本遍历类型1. Inorder(中序)(1) 递归(2) 使用栈迭代(3) Morris遍历(虚拟节点)2. Preorder( 前序)(1)递归(2)使用栈迭代(3)Morris遍历3. Postorder( 后序)(1) 递归(2) 使用栈迭代(3) Morris遍历Traversal(遍历)1. 基本遍历类型a. ...原创 2019-07-12 11:18:51 · 645 阅读 · 0 评论 -
算法总结 - 爬楼梯问题逐步优化,斐波那契类似问题套路
接触DP最早的应该就是这道题了吧,翻了翻leetcode submission发现最早的是在一年前… 而且是最基础的DP解法。在膜拜了大神们用矩阵甚至直接上斐波那契数列公式解法后觉得脑容量有点不太够用。。。嗯,需要写点东西捋一捋,所以这是一个学渣关于爬楼梯类型题目的总结,如果有不对的地方欢迎大家批评指正( ̄. ̄)。题目:Climbing StairsYou are climbing a sta...原创 2019-06-04 13:21:32 · 981 阅读 · 1 评论