2017年4月30日

LeetCode : K-diff Pairs in an Array

摘要: Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is defined a... 阅读全文

posted @ 2017-04-30 23:36 gechen 阅读(87) 评论(0) 推荐(0) 编辑

2017年4月28日

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.在haystack中查找needl... 阅读全文

posted @ 2017-04-28 22:57 gechen 阅读(63) 评论(0) 推荐(0) 编辑

2017年4月27日

LeetCode : Min Stack

摘要: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) – Push element x onto stack. pop() –... 阅读全文

posted @ 2017-04-27 23:22 gechen 阅读(72) 评论(0) 推荐(0) 编辑

LeetCode : Range Sum Query - Immutable

摘要: Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.Example: Given nums = [-2, 0, 3, -5, 2, ... 阅读全文

posted @ 2017-04-27 22:34 gechen 阅读(71) 评论(0) 推荐(0) 编辑

非阻塞IO与异步IO的区别

摘要: 对于非阻塞IO而言,当内核中数据准备好的时候,数据会从内核空间拷贝到用户内存中,这个时候进程是被block了,在这段时间内,进程是被block的。而异步IO则不一样,当进程发起IO 操作之后,就直接返回再也不理睬了,直到内核通过回调函数发送一个信号,通知进程IO完成。在这整个过程中... 阅读全文

posted @ 2017-04-27 09:23 gechen 阅读(163) 评论(0) 推荐(0) 编辑

2017年4月26日

LeetCode : Reverse Bits

摘要: Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100... 阅读全文

posted @ 2017-04-26 15:16 gechen 阅读(73) 评论(0) 推荐(0) 编辑

LeetCode : Nth Digit

摘要: Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, …Note: n is positive and will fit within the range of ... 阅读全文

posted @ 2017-04-26 14:51 gechen 阅读(72) 评论(0) 推荐(0) 编辑

2017年4月25日

腾讯面试问题总结

摘要: 昨天下午收到了腾讯的面试通知,感觉还是很开心的,因为至少笔试通过了。短信里面试官告诉自己第二天的下午进行电话面试。第二天下午三点如约接到了面试官的电话。首先腾讯的面试官态度很和蔼,一开始的紧张情绪就放松了下来。下面就将面试过程中的几个印象比较深的问题记录一下(大部分很基础,主要是几... 阅读全文

posted @ 2017-04-25 16:25 gechen 阅读(265) 评论(0) 推荐(0) 编辑

2017年4月24日

LeetCode : Intersection of Two Linked Lists

摘要: Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: A... 阅读全文

posted @ 2017-04-24 20:05 gechen 阅读(70) 评论(0) 推荐(0) 编辑

2017年4月23日

LeetCode : Longest Common Prefix

摘要: Write a function to find the longest common prefix string amongst an array of strings.class Solution {public: string longestCommonPrefix(v... 阅读全文

posted @ 2017-04-23 20:11 gechen 阅读(64) 评论(0) 推荐(0) 编辑

导航