自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(11)
  • 收藏
  • 关注

原创 (算法分析Week4)Count and Say[Easy]

38. Count and SayDescriptionThe count-and-say sequence is the sequence of integers with the first five terms as following:1. 1 2. 11 3. 21 4. 1211 5. 1112211 is read off as “one 1”

2017-09-30 13:02:54 241

原创 (算法分析Week4)Median of Two Sorted Arrays[Hard]

Topk问题,特殊化中位数。

2017-09-30 12:41:52 167

原创 (算法分析Week3)Merge Two Sorted Lists[Easy]

21. Merge Two Sorted ListsDescriptionMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.Solution考察对链表的操作,画个图一目了

2017-09-23 22:47:47 165

原创 (算法分析Week3)Reverse Integer[Easy]

7. Reverse IntegerDescriptionReverse digits of an integer.Example1: x = 123, return 321 Example2: x = -123, return -321Note: The input is assumed to be a 32-bit signed integer. Your function should r

2017-09-23 22:24:38 191

原创 (算法分析Week3)Pow(x,n)[Medium]

50. Pow(x, n)DescriptionImplement pow(x, n). 就是实现幂函数。Solution最直观的想法是递归,每次x*pow(x, n-1),觉得会超时,没写。 然后想着循环,试了一下,超时。 考虑到n个x相乘式子的对称关系,每次循环x*=x,可以把复杂度降到O(logn)Complexity analysisO(logn)Codeclass Solution

2017-09-23 22:06:31 224

原创 (算法分析Week2)Roman to Integer[Easy]

水题…… 只要知道罗马数字符号对应的整数就好了。

2017-09-16 13:58:06 200

原创 (算法分析Week2)3Sum[Medium]

241. Different Ways to Add Parentheses[Medium]DescriptionGiven an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the s

2017-09-15 21:55:19 220

原创 (算法分析Week2)Two Sum[Easy]

1. Two Sum[Easy]DescriptionGiven 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 y

2017-09-15 20:48:11 276

原创 (算法分析Week1)Different Ways to Add Parentheses[Medium]

241. Different Ways to Add Parentheses[Medium] Description Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and op

2017-09-10 19:13:18 273

原创 (算法分析Week1)Majority Element[Easy]

169. Majority Element[Easy]DescriptionGiven an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the array is no

2017-09-09 21:40:23 266

原创 (算法分析Week1)Maximum Subarray[Easy]

53. Maximum Subarray[Easy]DescriptionFind 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

2017-09-09 12:06:17 215

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除