![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法设计与原理练习题
四咸一声如裂帛
这个作者很懒,什么都没留下…
展开
-
LeetCode Devide & Conquer problem || Kth Largest Element in an Array
题目来源于LeetCode Devide & Conquer题库,简单分享我的解题思路,欢迎交流(●ˇ∀ˇ●)原创 2017-03-05 01:20:35 · 388 阅读 · 0 评论 -
392. Is Subsequence | LeetCode Dynamic Programming
本题来源于LeetCode动态规划题库,难度Medium。原创 2017-05-22 02:47:37 · 315 阅读 · 0 评论 -
515. Find Largest Value in Each Tree Row | Breadth-first Search
本体来源于LeetCode的BFS题库,难度Medium。原创 2017-06-11 23:00:24 · 308 阅读 · 0 评论 -
NP-Complete Problem Exercises
8.3 STINGY SATSTINGY SAT is the following problem: given a set of clauses(each a disjunction of literals) and an integer k, find a satisfying assignment in which at most k variables are true, if suc原创 2017-07-14 21:21:30 · 549 阅读 · 0 评论 -
Path Sum & Path Sum II | LeetCode DFS
题目来源于LeetCode DFS题库,难度分别为Easy和Medium原创 2017-07-06 17:10:45 · 278 阅读 · 0 评论 -
Sicilly 等价二叉树 | 算法期末机考模拟题
本题来源于Sicily算法设计期末机考模拟题。原创 2017-07-06 20:04:55 · 480 阅读 · 0 评论 -
Sicily 相连的1 | 算法期末机考模拟题
本题来源于Sicily算法期末机考模拟题。原创 2017-07-06 20:31:09 · 441 阅读 · 0 评论 -
Sicily 无环图 | 算法期末机考模拟题
本题来源于Sicily算法设计期末机考模拟题。原创 2017-07-06 19:56:17 · 351 阅读 · 0 评论 -
Sicily 会议安排 | 算法期末机考模拟题
本题来源于Sicily算法期末机考模拟题。原创 2017-07-06 21:10:41 · 529 阅读 · 0 评论 -
Sicily 最大和 | 期末算法机考模拟题
本题来源于Sicily期末算法机考模拟题。原创 2017-07-06 21:27:08 · 435 阅读 · 0 评论 -
406. Queue Reconstruction by Height | Leecode Greedy
本题来源于LeetCode greedy 题库,难度Medium。原创 2017-07-08 17:00:47 · 404 阅读 · 0 评论 -
54. Spiral Matrix Solution | Leetcode Array
Leetcode 54. Spiral MatrixDescriptionSolutionDescriptionGiven a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. difficulty: medium.Solution按上右下左四条...原创 2019-02-24 01:07:47 · 166 阅读 · 0 评论 -
变态跳台阶 | 剑指offer
题目描述一只青蛙一次可以跳上1级台阶,也可以跳上2级……它也可以跳上n级。求该青蛙跳上一个n级的台阶总共有多少种跳法。思路为了节省空间,本题尝试使用非递归方法解决。开辟一个数组series[number+1]存储各阶跳法。阶数为0时,返回0(不需要跳),series[0]=0;阶数为1时,一种跳法,series[1]=1;阶数为2时,两种跳法,(2),(1, 1),series[2]...原创 2019-02-28 21:29:19 · 186 阅读 · 0 评论 -
二进制中1的个数 | 剑指offer
题目描述输入一个整数,输出该数二进制表示中1的个数。其中负数用补码表示。思路分享此题在熟练掌握计组课上的编码基础后很好解决,难度不大。设输入的十进制数为n,二进制形式的1个数为cnt。正数实现正数按照常见的10转2进制方法实现即可:求n%2 = 1 则cnt加1;再另n = n / 2(整除);循环直至n == 0.负数实现负数稍微麻烦一些,按照定义,负数的补码为2^32 ...原创 2019-03-04 00:30:42 · 218 阅读 · 0 评论 -
377. Combination Sum IV | Leetcode Dynamic Programming
本题来源于LeetCode动态规划题库,难度Medium原创 2017-06-05 01:25:11 · 390 阅读 · 0 评论 -
486. Predict the Winner Add to List | Leetcode Dynamic Programming
本题来源于leetcode 动态规划题库,难度Medium。原创 2017-05-08 02:52:20 · 438 阅读 · 0 评论 -
LeetCode Sort Problem || Sort Colors
题目源于LeetCode Sort Problem,难度medium(实则easy),简单分享我的代码,欢迎交流。原创 2017-02-26 20:33:23 · 274 阅读 · 0 评论 -
LeetCode Array Problem || Teemo Attacking
源于LeetCode Array 题库,难度medium,件要分享解题思路,欢迎交流。原创 2017-02-26 17:39:14 · 336 阅读 · 0 评论 -
LeetCode Stack Problem || Next Greater Element
题目来源于LeetCode Stack Problem, 难度medium。原创 2017-02-26 22:26:22 · 455 阅读 · 0 评论 -
LeetCode Devide & Conquer Problem || Majority Element
本题来源于LeetCode Divide&Conquer题库,简单分享我的想法,欢迎交流(●ˇ∀ˇ●)原创 2017-03-05 22:15:47 · 407 阅读 · 0 评论 -
LeetCode Devide & Conquer || Search a 2D Matrix II
本题来源于LeetCode分治算法题库,难度medium.原创 2017-03-19 21:50:09 · 286 阅读 · 0 评论 -
Leetcode divide & conquer || Different Ways to Add Parentheses
本题来源于Leetcode Divide and Conquer题库,难度Medium原创 2017-03-12 20:32:51 · 328 阅读 · 0 评论 -
513. Find Bottom Left Tree Value | LeetCode
本题来源于LeetCode BFS题库,难度Medium。原创 2017-04-10 02:02:30 · 731 阅读 · 0 评论 -
53.Maximum Subarray | LeetCode 解题思路
本题来源于LeetCode devide and conquer题库,难度easy。原创 2017-03-26 21:31:20 · 474 阅读 · 0 评论 -
547. Friend Circles | LeetCode 解题思路
本题来自LeetCode DFS题库,难度Medium.原创 2017-04-04 22:51:08 · 1343 阅读 · 0 评论 -
455.Assign Cookies | LeetCode Greedy
本题来源于LeetCode Greedy题库,难度Easy.原创 2017-04-16 16:42:36 · 361 阅读 · 0 评论 -
452. Minimum Number of Arrows to Burst Balloons| Leetcode Greedy
本题来源于Leetcode Greedy题库,难度Medium。原创 2017-04-23 20:35:44 · 383 阅读 · 0 评论 -
413. Arithmetic Slices | LeetCode Dynamic Programming
本题来源于LeetCode 动态规划题库,难度Medium。原创 2017-05-14 20:10:55 · 263 阅读 · 0 评论 -
二叉搜索树的后序遍历序列 | 剑指offer
题目描述输入一个整数数组,判断该数组是不是某二叉搜索树的后序遍历的结果。如果是则输出Yes,否则输出No。假设输入的数组的任意两个数字都互不相同。解题思路回顾后序遍历序列的特性:最后一个元素为根,跟前面的序列可以分为小于根的前半部分(左子树)和大于根的后半部分(右子树)。因此用递归进行判断是最便利的。开辟两个新vector分别存储小于根的序列和大于根的序列。再分别将两个序列递归判断是否为后...原创 2019-03-10 23:18:41 · 181 阅读 · 0 评论