自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(92)
  • 资源 (1)
  • 收藏
  • 关注

原创 Leetcode:Wildcard Matching

Implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (including the empty sequence).The matching should cover t

2013-10-24 22:11:56 1086

原创 Leetcode:Trapping Rain Water

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example, Given [0,1,0,2,1,0,1,3,2,1,2,1]

2013-10-23 20:59:41 916

原创 Leetcode:First Missing Positive

Given an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.Your algorithm should run in O(n) time and uses constant

2013-10-23 16:27:01 11138 9

原创 Leetcode:Combination Sum II

Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.Each number in C may only be used once in the combina

2013-10-23 11:33:52 896

原创 Leetcode:Combination Sum

Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated number may be chosen from C unlimited numb

2013-10-22 23:27:15 1036

原创 Search for a Range

Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the order of O(log n).If the target is not found

2013-10-22 17:03:23 800

原创 Leetcode:Longest Valid Parentheses

Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid parentheses substring is "()",

2013-10-22 11:32:31 905

转载 链表有无环经典问题汇总

参考http://blog.csdn.net/vividonly/article/details/6673758

2013-10-19 22:26:11 730 1

原创 C++内存分配方式详解——堆、栈、自由存储区、全局/静态存储区和常量存储区

参考:C++内存分配方式详解——堆、栈、自由存储区、全局/静态存储区和常量存储区http://www.cnblogs.com/daocaoren/archive/2011/06/29/2092957.html   BSS段、数据段、代码段、堆与栈http://www.cppblog.com/prayer/archive/2009/08/17/93

2013-10-19 15:27:30 830

转载 如何判断两个矩形相交

假定矩形是用一对点表达的(minx, miny) (maxx, maxy),那么两个矩形    rect1{(minx1, miny1)(maxx1, maxy1)}    rect2{(minx2, miny2)(maxx2, maxy2)}  相交的结果一定是个矩形,构成这个相交矩形rect{(minx, miny) (maxx, maxy)}的点对坐标是:      minx

2013-10-15 14:38:12 1220

原创 数组首元素地址和数组地址、int *ptr=(int *)(&a+1)问题的探讨

参考http://blog.csdn.net/tsaiyong_ahnselina/article/details/11863557http://blog.csdn.net/yafeng_jiang/article/details/7321014数组名a和&a 的区别分类: c/c++ 2012-03-05 15:19 522人阅读 评论(2) 收藏 举报       

2013-10-13 17:06:50 2681

原创 关系型数据库笔试面试题

第一、二、三范式http://www.cnblogs.com/i233/archive/2009/04/08/1431627.html聚集索引、非聚集索引http://database.51cto.com/art/201104/257104.htm唯一索引 聚集索引 非聚集索引索引实际上是一组指向表中数据的指针,索引的排列顺序其实就是这组指针

2013-10-11 22:22:38 2153

转载 求和问题总结(leetcode 2Sum, 3Sum, 4Sum, K Sum)

转载自:http://tech-wonderland.net/blog/summary-of-ksum-problems.html前言:做过leetcode的人都知道, 里面有2sum, 3sum(closest), 4sum等问题, 这些也是面试里面经典的问题, 考察是否能够合理利用排序这个性质, 一步一步得到高效的算法. 经过总结, 本人觉得这些问题都可以使用一

2013-10-09 20:51:31 12460

原创 Leetcode:3Sum Closest

Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exa

2013-10-09 20:49:55 1328

转载 精选的一些《编程之美》相关资料

转载自:http://blog.csdn.net/wuyuegb2312/article/details/9896831又要到一年的招聘季了,肯定又有很多人开始啃《编程之美》了吧。这本书从开阔视野的角度来说很好,不过限于篇幅,有的问题并没有讲清楚(甚至问题叙述模棱两可、被标榜为“鼓励同面试官交流以获得更多细节”);或者扩展问题本身很难,没有给予解答和提示。在我看书并在网络上查到的相关资

2013-10-09 20:42:02 1229

原创 Regular Expression Matching 正则匹配问题

Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire in

2013-10-06 21:13:46 909

原创 最长回文串奇偶情况

Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.class Solution {

2013-10-06 15:26:19 895

原创 Longest Substring Without Repeating Characters

Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. Fo

2013-10-06 11:46:33 615

原创 两个有序数组的中位数 Median of Two Sorted Arrays

Leetcode上的一道题:There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).class Solutio

2013-10-05 23:45:15 953

原创 常见概念笔试题

1.TCP建立连接的三次握手?http://blog.csdn.net/whuslei/article/details/66674712.死锁的条件互斥条件(Mutual exclusion):资源不能被共享,只能由一个进程使用。请求与保持条件(Hold and wait):已经得到资源的进程可以再次申请新的资源。非剥夺条件(No pre-emption):已经分配

2013-09-26 18:23:31 879

原创 vim打造成IDE

http://blog.csdn.net/liu_sheng_no_one/article/details/6860452

2013-09-05 19:37:35 644

原创 C++ url encode decode

鉴于有时要用C++ 写CGI,url encode、decode是必不可少的,有必要单独整理下。这里吐槽下,C++做web真是笨重,没有python、php爽。http://blog.csdn.net/nanjunxiao/article/details/9303619之前写过一个简单的encode,这里补充更新下。#include #include using namespace s

2013-08-15 00:27:48 4418 1

转载 C++ 大整数运算

//copyright@ 2011/03/06 yansha //实现大整数类 #include #include #include using namespace std; class CBigInt { public: // input friend istream& operator >> (istream &, CBigI

2013-08-15 00:20:32 3531

原创 Python编码问题

python里面基本上要考虑三种编码格式:1 源文件编码在文件头部使用coding声明。告诉python解释器该代码文件所使用的字符集。#/usr/bin/python#coding: utf82 内部编码代码文件中的字符串,经过decode以后,被转换为统一的unicode格式的内部数据,类似于u'*'。unicode数据可以使用encode函数,再自由转换为其他格式

2013-08-01 17:35:11 637

原创 Python IDE Eric4安装配置

http://blog.csdn.net/fairyeye/article/details/6607981http://www.cnblogs.com/lhj588/archive/2011/10/03/2198472.html

2013-07-30 18:10:35 689

转载 MapReduce:详解Shuffle过程

Shuffle过程是MapReduce的核心,也被称为奇迹发生的地方。要想理解MapReduce, Shuffle是必须要了解的。我看过很多相关的资料,但每次看完都云里雾里的绕着,很难理清大致的逻辑,反而越搅越混。前段时间在做MapReduce job 性能调优的工作,需要深入代码研究MapReduce的运行机制,这才对Shuffle探了个究竟。考虑到之前我在看相关资料而看不懂时很恼火,所以在这里

2013-07-29 19:41:01 561

转载 linux远程管理的屠龙刀

对linux进行远程管理,我个人喜欢用putty。因为它是个短小精悍的工具,完全可以满足你的使用需求。SecureCRT不止一次听说过,也不止一次试用过:发现它有标签功能的时候用过;发现它不用借助其它工具可以直接上传下载文件的时候用过;发现别人用它来管理cisco的时候也再次用过。不知道是不是先入为主的原因,就是一直没有喜欢上它,相反却觉得特别不顺手,还特别生气这么难使的东东还要收费!直到两个月前

2013-07-24 21:10:42 734

转载 libcurl的share interface与curl_easy_perform的性能

转载自:http://blog.csdn.net/mobary/article/details/6010536最近在使用libcurl实现客户端程序和http server通讯功能的时候,发现libcurl的性能不好。具体情况是我在每次http连接时初始化一个新的curl handle,参数设置完成后,调用curl_easy_perform方法执行本连接。 如果程序中需要用到h

2013-07-19 16:10:38 1198

原创 python使用HTMLParser和BeautifulSoup解析网页

HTMLParser是python自带的网页解析库,使用也很简单,主要需要继承基类HTMLParser,然后重载handle_starttag、handle_data、handle_endtag三个函数即可。下面给出一个抽取网页链接的示例#!/usr/bin/env python#coding=utf-8from HTMLParser import HTMLParsercla

2013-07-16 21:24:25 10131

原创 python操作mysql

之前一直C++连数据库,略显笨重,最近主题就是黑C++,python操作mysql还是比较方便的。我用的windows32位,直接安装的编译好MySQLdb,下载地址http://www.codegood.com/downloadsimport MySQLdb ok就安装成功了。#coding=utf-8#!/usr/bin/env pythonimport MySQLdbc

2013-07-15 22:53:30 647

原创 python urllib2 cookielib处理验证码模拟人人登陆

又重新学了下python的urllib2,参考http://www.cnpythoner.com/post/30.html和http://www.pythoner.com/65.html,写了个登陆人人的脚本,能够处理验证码的情况会jpg写到本地,主页新鲜事正则貌似有点问题,先不管了。# -*- coding: utf-8 -*-import urllibimport urllib2i

2013-07-15 21:18:45 3327 1

原创 c++ urlencode简单实现

string urlencode(const string& str){ char* cmem = new char[str.size()*3 + 1] memset(cmem,0,str.size()*3+1); for(size_t i=0; i<str.size(); ++i) { sprintf(cmem+i*3

2013-07-11 19:14:46 2078

原创 python urllib2

http://zhuoqiang.me/python-urllib2-usage.html#id5http://bbs.csdn.net/topics/300178836http://docs.python.org/2/library/urllib2.html

2013-07-10 21:20:27 684

原创 百度开放云骑士之夜hacknight--酱油篇

2013年7月6日-7月7日,在师兄带领下酱油了把hackathon,经过了36小时的洗礼,我们的IKM一站式个人知识管理原型终于出炉,还拿了个三等奖,(*^__^*) 。而且我们的Demo得到了评委和百度云的一致认可,会后百度云首席布道师张辉还亲自过来交流求合作,哈,终于和上过天天向上的人合影了。名称:IKM 一站式个人知识管理项目详情:通过一站式“框”搜索,帮助用户查找邮件、Eve

2013-07-09 12:09:19 1427

转载 linux下内存泄露检测方法

本文针对 linux 下的 C++ 程序的内存泄漏的检测方法及其实现进行探讨。其中包括 C++ 中的 new 和 delete 的基本原理,内 存检测子系统的实现原理和具体方法,以及内存泄漏检测的高级话题。作为内存检测子系统实现的一部分,提供了一个具有更好的使用特性的互斥体 (Mutex)类。1.开发背景在 windows 下使用 VC 编程时,我们通常需要 DEBUG 模式下

2013-07-01 20:59:39 3760

原创 主定理

对于T(n) = a*T(n/b)+c*n^k;T(1) = c 这样的递归关系,有这样的结论:if (a > b^k)   T(n) = O(n^(logb(a)));if (a = b^k)   T(n) = O(n^k*logn);if (a

2013-07-01 11:20:55 723

原创 数组、字符串、链表、树面试题汇总

数组1.      如何用递归实现数组求和2.      如何用一个for打印出一个二维数组A[count/col][count%col]3.      在顺序表中插入和删除一个节点平均移动多少个节点插入:(0+n)/2删除:(0+n-1)/24.      如何用递归算法判断一个数组是否是递增?Bool up(int a[],int beg,int end){

2013-06-26 20:57:50 2251

原创 程序员面试题精选100题:51-63解题报告

程序员面试题精选100题(51)-顺时针打印矩阵[算法]  题目:输入一个矩阵,按照从外向里以顺时针的顺序依次打印出每一个数字。例如:如果输入如下矩阵:1              2              3              45              6              7              89              10

2013-06-26 00:07:09 1586

原创 程序员面试题精选100题:41-50解题报告

程序员面试题精选100题(41)-把数组排成最小的数[算法]  题目:输入一个正整数数组,将它们连接起来排成一个数,输出能排出的所有数字中最小的一个。例如输入数组{32,  321},则输出这两个能排成的最小数字32132。请给出解决问题的算法,并证明该算法。根据题目的要求,两个数字m和n排成的数字mn和nm,如果mn接下来我们考虑怎么去拼接数字,即给出数字m和n,怎么得到数字mn和n

2013-06-25 18:18:38 1626

原创 程序员面试题精选100题:11-40解题报告

程序员面试题精选100题(11)-求二元查找树的镜像[数据结构]  题目:输入一颗二元查找树,将该树转换为它的镜像,即在转换后的二元查找树中,左子树的结点都大于右子树的结点。用递归和循环两种方法完成树的镜像转换。例如输入:     8    /  \  6      10 /\       /\5  7    9   11输出:      8    /  \

2013-06-25 14:37:19 2377

xiaomi IPO

xiaomi ipo pdf 中期互联网从业者需要关注的资源,速度

2018-08-22

空空如也

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

TA关注的人

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