自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 leetcode009 Palindrome Number

题目:Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (ie, -1)If you are thinking of conver

2015-09-27 23:12:16 312

原创 leetcode007 Reverse Integer

题目要求:Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321思路并不难想,这题的难点主要在于溢出的问题,如果溢出需要返回0。因此首先需要得到int类型的最大值和最小值。经过网上查资料,找到两种方法。第一种是用#include头文件,然后使用

2015-09-27 14:22:46 306

原创 leet006 ZigZag Conversion

题目要求:The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA P

2015-09-27 13:03:37 384

原创 leetcode002 Add Two Numbers

题目:You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as

2015-09-26 22:26:35 390

原创 leetcode001 Two Sum

一开始想用头部一个指针尾部一个指针的思路来做。后来看了网上的攻略才发现数组是乱序的。网上的思路比较巧妙,用了一个hashmap,其中key值为数组的value,value值为数据的index,查找的复杂度为O(N)代码如下:vector twoSum(vector& nums, int target) { vector ret; map m; for(

2015-09-26 22:22:33 305

原创 阿里巴巴中间件性能挑战赛(MOM篇)

先贴一下赛题:实现一个基于发布-订阅模型的消息中间件(broker+client)必选特性:提供可靠消息服务,broker要保证数据同步落盘才能向生产者返回发送成功的ack,并保证投递给所有的消费者,直至所有的消费者都消费成功(消费者消费成功或者失败都会返回对应的ack)。一旦消费者对一条消息发生订阅后,那么该消费者消费失败,消费超时(如果消息推送给消费者后,10秒没有返回响应,那

2015-09-26 17:08:54 2542 1

原创 阿里巴巴中间件性能挑战赛(RPC篇 复杂版)

与简单版相比,整个的思路没有什么变化,不过网络io模型换成了netty,同时使用了fst序列化库//调用方法的协议:方法名 参数类型 参数值 上下文 @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if(isAsy

2015-09-26 16:53:14 1348

原创 阿里巴巴中间件性能挑战赛(RPC篇 同步阻塞模型)

阿里巴巴中间件性能挑战赛RPC部分的总结

2015-09-26 15:51:18 1687

空空如也

空空如也

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

TA关注的人

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