自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

LovePeppa的专栏

你当温柔,却有力量

  • 博客(14)
  • 资源 (1)
  • 问答 (1)
  • 收藏
  • 关注

原创 LeetCode算法题之Multiply Strings

问题描述: Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large and are non-negative. 一个数字以字符串的形式相乘,这就意味着传统的乘法肯定不能满足,计算机表

2015-03-31 19:45:04 460

原创 LeetCode算法题之Rotate Image

问题描述: You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Follow up: Could you do this in-place? 要求不能另开空间,一开始理解错了,后来画图明白了 解题思路: 首先以对角线为轴对称交换,再以中间列

2015-03-31 14:02:07 946

原创 LeetCode算法题之Anagrams

问题描述: Given an array of strings, return all groups of strings that are anagrams. Note: All inputs will be in lower-case. Anagrams指的是具有如下特性的两个单词:在这两个单词当中,每一个英文字母(不区分大小写)所出现的次数都是相同的。 例如,“Unclear”和“Nu

2015-03-31 12:13:58 523

原创 LeetCode算法题之Permutations

问题描述: Given a collection of numbers, return all possible permutations. For example, [1,2,3] have the following permutations: [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1]. 给一个内部元素互不相等的集

2015-03-30 20:08:49 436

原创 LeetCode算法题之Pow(x, n)

问题描述:Implement pow(x, n).自己写函数实现乘方运算解题思路:直接实现肯定超时,并且要考虑指数为0,指数为1,指数为负,底数为0的特殊情况,此题用递归方法实现,以下代码来自《剑指offer》,此代码写的太赞了,如果想详细了解解题思路请买书!!刚看完所以直接贴上去运行了,必然轻松A过,向大神致敬!!!bool g_InvalidInput = fals

2015-03-27 17:35:51 467

原创 LeetCode算法题之Count and Say

//问题描述The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11 is read off as "two 1s" or 21.21 is read o

2015-03-27 15:55:08 457

原创 LeetCode算法题之Implement strStr()

问题描述:Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.字符串匹配解题思路:暴力破解和KMP算法,后者还没认真学习,直接一个个比较了!class Soluti

2015-03-27 09:58:21 532

原创 LeetCode算法题之Remove Duplicates from Sorted Array

问题描述:Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in

2015-03-26 17:15:00 450

原创 Python爬虫爬取百度搜索结果——邮箱地址

因为需要拿一些外部邮箱做测试,所以要获得一些真实的邮箱地址,我在百度上搜索"@xxxx.com.cn"(xxxx保密,哈哈)之后,得到大概1,700,000条结果。但我只需要一千个不重复的就够了,鼓捣了一下午终于搞定,直接贴上代码,具体说明都写在注释里。(另外我发现学会正则表达式真的特别重要,附上大神写的正则表达式学习指南:http://www.cnblogs.com/huxi/archive/2

2015-03-24 14:19:02 6201 2

原创 LeetCode算法题之Valid Parentheses

问题描述:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}" are all v

2015-03-23 17:05:27 402

原创 LeetCode算法题之Letter Combinations of a Phone Number

问题描述:手机键盘上的数字对应着若干个字母,输入一组由数字组成的字符串,对应输出相应的字母的所有可能组合,顺序不限解题思路:暴力破解可以得到结果相当于遍历一棵树,可以使用数的遍历算法DFS25 / 25 test cases passed.Status: AcceptedRuntime: 3 ms

2015-03-16 16:24:36 425

原创 POJ之1012

问题描述:有k个坏人k个好人坐成一圈,前k个为好人(编号1~k),后k个为坏人(编号k+1~2k),现在从编号1开始报数,一直报到m,一轮结束后,必须要求第m个报数的人死掉,而且他要是坏人,在他死掉之后继续从他的下一个开始报数,也是从1开始报到m,第m个是坏人,拉出去毙掉,直到坏人全部死去,好人全部留下,我们需要编程找到这个值m; 解题思路: 推导时要注意2点:第一:每

2015-03-13 15:15:52 580

原创 POJ之1014

/*两人分石头,要求平分,但石头大小不一,价值也不一样,从1到20000,如果一堆石头的总价是奇数显然不可分,则输出不可分割否则再看这堆石头是否能被分成两份,在保证石头完好无损的情况下。输入1 0 1 2 0 0代表价值为1的1个,价值为2的0个,·····;即有四块价值分别为4,4,3,1的石头,显然这石头是没法分的输入1 0 0 0 1 1代表·····,即有三块价值为6,5,

2015-03-10 18:43:34 359

原创 自学数据挖掘十大算法之PageRank

PageRank是Google用来衡量一个网站好坏的唯一标准,Google将其分为0—10级,一般PR值达到4,该网站已经很不错了,Google将自己的网站等级定为10。对于某个互联网网页A来说,该网页的PageRank值的计算基于两个假设: 数量假设在Web图模型中,如果一个页面节点接收到的其他网页的入链数量越多那么这个网页越重要。

2015-03-05 22:11:02 1414

MySQL-Python for Windows 64位

使用在此windows系统中的python来安装一个mysqldb模块

2015-04-30

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

TA关注的人

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