自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 最大子序列和问题的解_

问题:有数n1,n2,......,ns。求一个连续的子序列,这个序列的和最大。这个问题有O(n^3)、O(n^2)、O(n*lgn)以及O(n)时间复杂度的解法。下面主要说下O(n*lgn)和O(n)的解法。

2016-12-14 19:47:43 485

原创 Min Stack_栈_保存最小值(用数组)

题目:Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- G

2016-12-09 20:25:18 339

原创 204. Count Primes_找n以内的质数_hash

题目以及解法思路答案在原网页上都有。https://leetcode.com/problems/count-primes/Description:Count the number of prime numbers less than a non-negative number, n.Hint:Let's start with a isPrime function.

2016-12-08 20:03:58 342

原创 Implement strStr()--字符串匹配_kmp_bkdHash

Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.两种方法:1)bkdHash2)kmp代码分别如下://bkdHashint strStr(string

2016-12-08 19:08:11 344

空空如也

空空如也

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

TA关注的人

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