![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法设计课程
文章平均质量分 59
mj397062482
这个作者很懒,什么都没留下…
展开
-
2017.3.2 94. Binary Tree Inorder Traversal [easy]
Given a binary tree, return the inorder traversal of its nodes' values.For example:Given binary tree [1,null,2,3], 1 \ 2 / 3return [1,3,2].Note: Recursive solu原创 2017-03-02 08:58:40 · 143 阅读 · 0 评论 -
算法设计大作业 8章第3题
题目STINGY 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 such an as原创 2017-07-11 09:35:12 · 1046 阅读 · 0 评论 -
2017年6月17日22:32:41 456. 132 Pattern [easy]
Given a sequence of n integers a1, a2, ..., an, a 132 pattern is a subsequence ai, aj, ak such that i j k and ai < ak j. Design an algorithm that takes a list of n numbers as input and check原创 2017-06-17 22:32:48 · 190 阅读 · 0 评论 -
2017年5月21日12:35:53354. Russian Doll Envelopes
You have a number of envelopes with widths and heights given as a pair of integers (w, h). One envelope can fit into another if and only if both the width and height of one envelope is greater than th原创 2017-05-22 12:35:53 · 221 阅读 · 0 评论 -
2017年6月4日22:08:33 238. Product of Array Except Self 【medium】
Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements ofnums except nums[i].Solve it without division原创 2017-06-04 22:08:36 · 166 阅读 · 0 评论 -
2017年5月28日22:28:47154. Find Minimum in Rotated Sorted Array II
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a target value to search. If foun原创 2017-05-29 22:28:48 · 167 阅读 · 0 评论 -
2017年4月23日 448. Find All Numbers Disappeared in an Array[easy]
Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.Find all the elements of [1, n] inclusive that do not appear in this array.原创 2017-04-23 16:30:07 · 116 阅读 · 0 评论 -
2017年5月1日13:01:52 389. Find the Difference [easy]
Given two strings s and t which consist of only lowercase letters.String t is generated by random shuffling string s and then add one more letter at a random position.Find the letter that was原创 2017-05-01 13:02:24 · 389 阅读 · 0 评论 -
2017年4月9日21:37:54 145. Binary Tree Postorder Traversal 【】hard
Given a binary tree, return the postorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [3,2,1].hard题中很简单的二叉树遍历 /原创 2017-04-09 21:38:46 · 154 阅读 · 0 评论 -
2017.3.12 104. Maximum Depth of Binary Tree
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.Subscribe to see which compani原创 2017-03-12 23:22:56 · 163 阅读 · 0 评论 -
2017.3.19 520. Detect Capital[easy]
Given a word, you need to judge whether the usage of capitals in it is right or not.We define the usage of capitals in a word to be right when one of the following cases holds:All letters in t原创 2017-03-19 08:07:40 · 194 阅读 · 0 评论 -
2017.2.25 1. Two Sum [easy]
Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the same原创 2017-02-25 13:59:36 · 290 阅读 · 0 评论 -
2017.3.2 53. Maximum Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [-2,1,-3,4,-1,2,1,-5,4],the contiguous subarray [4,-1,2,1] ha原创 2017-03-02 09:35:13 · 240 阅读 · 0 评论 -
2017年6月11日22:54:14 539. Minimum Time Difference [medium]
539. Minimum Time DifferenceGiven a list of 24-hour clock time points in "Hour:Minutes" format, find the minimum minutes difference between any two time points in the list.Example 1:原创 2017-06-11 22:55:01 · 230 阅读 · 0 评论