码迷,mamicode.com
首页 >  
搜索关键字:two pointers    ( 12138个结果
【leetcode】Populating Next Right Pointers in Each Node
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointe...
分类:其他好文   时间:2014-07-22 23:16:35    阅读次数:373
Leetcode:Container With Most Water
戳我去解题Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoint...
分类:其他好文   时间:2014-07-22 23:09:34    阅读次数:337
[leetcode]Two Sum @ Python
原题地址:http://oj.leetcode.com/problems/two-sum/题意:找出数组numbers中的两个数,它们的和为给定的一个数target,并返回这两个数的索引,注意这里的索引不是数组下标,而是数组下标加1。比如numbers={2,7,11,17}; target=9。那...
分类:编程语言   时间:2014-04-30 21:45:43    阅读次数:528
UVA 10891 Game of Sum(DP)
This is a two player game. Initially there areninteger numbers in an array and playersAandBget chance to take them alternatively. Each player can take...
分类:其他好文   时间:2014-04-30 20:34:38    阅读次数:519
something about basic usage of vector,queue
1.for a two dimension vector, we must assign at least the first dimension of the vector2.each dimension of an inner vector can be different3.if you do...
分类:其他好文   时间:2014-04-30 18:47:20    阅读次数:549
LeetCode4: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 sin...
分类:其他好文   时间:2014-04-30 18:44:23    阅读次数:428
《Cracking the Coding Interview》——第18章:难题——题目1
2014-04-29 00:56题目:不用算数运算,完成加法。解法:那就位运算吧,用加法器的做法就可以了。代码: 1 // 18.1 add two numbers wihout using arithmetic operator. 2 #include 3 using namespace std....
分类:其他好文   时间:2014-04-29 14:58:53    阅读次数:383
外观模式-分层架构,方便维护遗留下的大型的系统
public class Facade { /** * @param args 外观模式 */ One one; Two two; Three three; public Facade() { one=new One(); two=new Two(); three=new Three()...
分类:其他好文   时间:2014-04-29 11:15:47    阅读次数:238
LeetCode2:Median of Two Sorted Arrays
题目: 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...
分类:其他好文   时间:2014-04-29 10:32:46    阅读次数:359
LeetCode——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 ...
分类:其他好文   时间:2014-04-29 10:17:46    阅读次数:406
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!