2015年10月9日

Redis阻塞队列原理学习

摘要: 转载请注明来自http://www.cnblogs.com/pengyu2003/p/4864918.html1.redis介绍Redis是一个开源的使用ANSIC语言编写、支持网络、可基于内存亦可持久化的日志型、Key-Value数据库,并提供多种语言的API。2.阻塞队列使用非阻塞队列的时候有一... 阅读全文

posted @ 2015-10-09 19:43 pengyu2003 阅读(5202) 评论(0) 推荐(0) 编辑

2015年5月12日

the enum hack

摘要: 一个枚举类型的数值可权充int被利用class GamePlayer{ enum { NumTurns = 5}; ... int scores[NumTurns];} 阅读全文

posted @ 2015-05-12 15:35 pengyu2003 阅读(183) 评论(0) 推荐(0) 编辑

2014年5月7日

Divide Two Integers

摘要: Divide two integers without using multiplication, division and mod operator.题的思路不难,但是没有注意数据的大小问题。之前一直用int做,一直不能通过。换成long long才通过。class Solution {publi... 阅读全文

posted @ 2014-05-07 10:28 pengyu2003 阅读(155) 评论(0) 推荐(0) 编辑

2014年4月23日

Surrounded Regions

摘要: Given a 2D board containing'X'and'O', capture all regions surrounded by'X'.A region is captured by flipping all'O's into'X's in that surrounded region... 阅读全文

posted @ 2014-04-23 22:27 pengyu2003 阅读(144) 评论(0) 推荐(0) 编辑

Search in Rotated Sorted Array

摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).You are given a target value t... 阅读全文

posted @ 2014-04-23 11:00 pengyu2003 阅读(99) 评论(0) 推荐(0) 编辑

2014年4月22日

Binary Tree Zigzag Level Order Traversal

摘要: Given a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then right to left for the next level and al... 阅读全文

posted @ 2014-04-22 22:43 pengyu2003 阅读(130) 评论(0) 推荐(0) 编辑

2014阿里实习面试经历

摘要: 从三月下旬到4月21号,断断续续一个月的超长电面现场面,终于告一段落。最终结果要到5月才能等到。简单记录一下这段经历,希望对其他人有帮助。我的阿里实习是走的内推的线路,不过这线路着实坑……本人先后经历3轮电面、1轮笔试和1轮现场面,其中现场面试技术面+hr面。总之被面的欲仙欲死,很多很牛的小伙伴都被... 阅读全文

posted @ 2014-04-22 21:38 pengyu2003 阅读(1138) 评论(0) 推荐(0) 编辑

2014年4月19日

Trapping Rain Water

摘要: Givennnon-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.Fo... 阅读全文

posted @ 2014-04-19 22:59 pengyu2003 阅读(141) 评论(0) 推荐(0) 编辑

Jump Game II

摘要: Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu... 阅读全文

posted @ 2014-04-19 22:12 pengyu2003 阅读(129) 评论(0) 推荐(0) 编辑

Interleaving String

摘要: Givens1,s2,s3, find whethers3is formed by the interleaving ofs1ands2.For example,Given:s1="aabcc",s2="dbbca",Whens3="aadbbcbcac", return true.Whens3="... 阅读全文

posted @ 2014-04-19 11:49 pengyu2003 阅读(135) 评论(0) 推荐(0) 编辑

导航