码迷,mamicode.com
首页 >  
搜索关键字:two pointer    ( 13796个结果
package-info.java
问题:看开源项目发现这个package-info.java文件有些特殊,从名字上面也可以猜出这个类是与package有关的。具体是怎么回事呢?:就是记录包的信息To create a package comment file, you have a choice of two files to pl...
分类:编程语言   时间:2014-05-23 09:39:01    阅读次数:328
Linus Torvalds 指针
《对话LinusTorvalds:大多黑客甚至连指针都未理解》http://www.csdn.net/article/2013-01-10/2813559-two-star-programming“不懂指针”的开发者代码示例: 1 typedef struct node 2 { 3 ...
分类:其他好文   时间:2014-05-22 04:40:17    阅读次数:245
一段小程序理解getchar和putchar
#include "stdafx.h"#include using namespace std;int main(){ char c,d,e,f; printf("please input two characters:\n"); c=getchar(); putchar...
分类:其他好文   时间:2014-05-21 23:46:19    阅读次数:352
go中string和slice no-copy转换
在go里面,string和slice的互换是需要进行内存拷贝的,虽然在底层,它们都只是用 pointer + len来表示的一段内存。通常,我们不会在意string和slice的转换带来的内存拷贝性能问题,但是总有些地方需要关注的,刚好在看vitess代码的时候,发现了一种很hack的做法,stri...
分类:其他好文   时间:2014-05-21 19:53:21    阅读次数:223
从两个TIMESTAMP中获取时间差(秒)
When you subtract two variables of type TIMESTAMP, you get an INTERVAL DAY TO SECOND which includes a number of milliseconds and/or microseconds depending on the platform. If the database is running o...
分类:其他好文   时间:2014-05-21 15:36:38    阅读次数:488
LeetCode: Count and Say [037]
【题目】 The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, ... 1 is read off as "one 1" or 11. 11 is read off as "two 1s" or 21. 21 is read off as "one 2, then one 1" or 1211. Given an integer n, generate...
分类:其他好文   时间:2014-05-21 15:20:07    阅读次数:213
leetcode -day20 Add Two Numbers
1、 ?? 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 num...
分类:其他好文   时间:2014-05-21 10:49:10    阅读次数:221
Lock-free vs. wait-free concurrency
There are two types of non-blocking thread synchronization algorithms - lock-free, and wait-free. Their meaning is often confused. In lock-free systems, while any particular computation may be block...
分类:其他好文   时间:2014-05-21 10:27:20    阅读次数:410
【leetcode】Divide Two Integers
题目:不用乘、除、取模运算来实现除法。 减法可以实现除法在是我们早就知道的,但是可能会出现问题,比如极端情况,a = 0x7FFFFFFF,b = 1,求a/b,这要减法运算多少次? 回想下我们开始学习计算机的时候,涉及到的进制之间的转换,就是给定你一个十进制数,写出他的二进制,刚开始的时候很傻,就按着书上的方法去不停的除以2,除以2,除以2,。。。可笑的是居然天真的算过1024的二进制,更可...
分类:其他好文   时间:2014-05-21 08:32:30    阅读次数:191
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 t...
分类:其他好文   时间:2014-05-21 07:42:18    阅读次数:230
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!