自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

guokaiwhu

总结是最好的学习

  • 博客(19)
  • 收藏
  • 关注

原创 【LeetCode刷题记录】H-Index

题目Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher’s h-index.According to the definition of h-index on Wikipedia: “A sci

2015-10-18 20:47:07 646

原创 【LeetCode刷题记录】LRU Cache

题目Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.get(key) - Get the value (will always be positive) of the key if the

2015-10-16 13:38:06 575

原创 【LeetCode刷题记录】Integer to English Words

题目Convert a non-negative integer to its english words representation. Given input is guaranteed to be less than 231 - 1.For example, 123 -> “One Hundred Twenty Three” 12345 -> “Twelve Thousand Three

2015-10-12 22:23:27 680

原创 【LeetCode刷题记录】Two Sum

题目Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target, where

2015-05-21 09:29:56 610

原创 【LeetCode刷题记录】Reverse Integer

题目Reverse digits of an integer.Example1: x = 123, return 321 Example2: x = -123, return -321Here are some good questions to ask before coding. Bonus points for you if you have already thought through

2015-05-07 21:49:54 560

原创 【LeetCode刷题记录】Reverse Bits

题目Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary as 001110010111

2015-05-06 22:02:19 583

原创 【LeetCode刷题记录】Pascal's Triangle II

题目Given an index k, return the kth row of the Pascal’s triangle.For example, given k = 3, Return [1,3,3,1].Note: Could you optimize your algorithm to use only O(k) extra space?解答这题和Pascal Triangle相近,

2015-04-26 22:08:11 562

原创 【LeetCode刷题记录】Pascal's Triangle

题目:Given numRows, generate the first numRows of Pascal’s triangle.For example, given numRows = 5, Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1] ]解答:帕斯卡三角,又名“杨辉三角”,基本规律是每一行的第

2015-04-25 18:01:42 615 1

原创 【LeetCode刷题记录】Number of 1 Bits

题目:Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).For example, the 32-bit integer ’11' has binary representation 000

2015-04-20 08:54:23 535

原创 【LeetCode刷题记录】Single Number

题目一:Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without u

2015-04-16 22:43:14 584

原创 【LeetCode刷题记录】Merge Sorted Array

题目:Merge Sorted Array Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal to m + n) to hold a

2015-04-15 08:30:42 568

原创 Google论文小结之Chubby

前前后后把这篇论文通读了两三遍,但作为一只刚踏入分布式领域的菜鸟,在感叹Google大牛们的奇思妙想之外,更多的是思考能从这篇大作中汲取出一些对自身思维和眼界有启迪的东西。资历尚浅,谨以小结笔记的方式记录下所读所想。我主要是结合此处的中文版去理解原文,地址:http://duanple.blog.163.com/blog/static/70971767201142412058672/。

2015-04-14 19:37:06 1643

原创 【LeetCode刷题记录】Rotate Array

LeetCode数组题之Rotate Array

2015-04-14 08:30:40 552

原创 Android Studio下集成ShareSDK

Android Studio是Google推出的最新用来编写安卓应用程序的IDE,意在逐渐取代Eclipse,具体比较可参考知乎上的这个帖子:Android Studio 比Eclipse好用在哪里。而ShareSDK是为iOS、Android、WP8的APP提供社会化分享功能的一个组件,开发者只需10分钟即可集成到自己的APP中,它不仅支持如QQ、微信、新浪微博、腾讯微博、开心网、人

2014-03-14 04:27:29 2507 2

原创 IBus输入法之‘i’nteresting

学习Linux的过程是相对枯燥的,所以有时候我们得在枯燥之中顺便找点有趣的东西,譬如今日偶然觅得IBus输入法下‘i’nteresting的i输入。输入'i',可以进行如下操作:1.hh.画画生日蛋糕(birthday)..........................................................................

2013-07-10 21:01:43 1235

原创 由异或实现两个数的交换到RAID技术的数据恢复

前言这篇博文源于在新浪微博上看到SinaAppEngine发的一条“一张图了解普通程序员、文艺程序员和2B程序员的区别”(原微博见点击打开链接)。里面提到文艺程序员采用两数异或的方法处理交换,自己在处理这个问题没想到。于是乎,抱着学习的心态,查找了一点详细的资料以解心头之惑。而且,顺藤摸瓜地无意间看见了RAID技术中数据恢复的异曲同工的处理方法。以下是个人整理的一点拙见,权当记笔记和给同样有疑

2013-07-01 18:26:06 1574

转载 C语言之详解#ifdef等宏及妙用

这几个宏是为了进行条件编译。一般情况下,源程序中所有的行都参加编译。但是有时希望对其中一部分内容只在满足一定条件才进行编译,也就是对一部分内容指定编译的条件,这就是“条件编译”。有时,希望当满足某条件时对一组语句进行编译,而当条件不满足时则编译另一组语句。     条件编译命令最常见的形式为:     #ifdef 标识符     程序段1     #else     程序段2

2012-11-22 15:04:15 612

转载 时间复杂度和空间复杂度

没有挤公交来上班过,就不知道生活的压力有多大。算法的时间复杂度和空间复杂度合称为算法的复杂度。1.时间复杂度(1)时间频度 一个算法执行所耗费的时间,从理论上是不能算出来的,必须上机运行测试才能知道。但我们不可能也没有必要对每个算法都上机测试,只需知道哪个算法花费的时间多,哪个算法花费的时间少就可以了。并且一个算法花费的时间与算法中语句的执行次数成正比例,哪个算法中

2012-11-09 19:53:27 1117

转载 快速模取幂算法

快速模取幂    数论计算中经常出现的一种运算就是求一个数的幂ab对另外一个数n个模的运算,即计算:ab mod n (a,b,n是正整数)    由于计算机只能表示有限位的整数,所以编程时模取幂的运算要注意值的大小范围,当ab的值超过整数范围时,mod运算便无法进行。    如何解决这个问题,我们引出一个能计算ab mod n的值的有用算法——反复平方法,首先我们

2012-10-24 16:14:57 882

空空如也

空空如也

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

TA关注的人

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