码迷,mamicode.com
首页 >  
搜索关键字:two pointer    ( 13796个结果
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
Same Tree
Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical an...
分类:其他好文   时间:2014-05-01 16:06:46    阅读次数:427
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 nu...
分类:其他好文   时间:2014-05-01 08:35:40    阅读次数:443
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
C、C++智能指针
这篇文章主要来源于:codeguru网站的一篇文章:A TR1 tutorial:smart pointer (详细介绍了C++的智能指针,尤其是shared_ptr)。众所周知,在 TR1 之前,C++标准库中的智能指针只有auto_ptr,但由于它的【排他所有权模式】(exclusive own...
分类:编程语言   时间:2014-04-30 18:01:06    阅读次数:478
Timus 1642. 1D Maze迷宫
1D people lived in a 1D country. Everything in the country was one-dimensional, and everything was simple and clear: just one axis and two directions — forward and backward. Even a 1D world has proble...
分类:其他好文   时间:2014-04-29 13:44:22    阅读次数:284
Pat(Advanced Level)Practice--1063(Set Similarity)
Pat1063代码 题目描述: Given two sets of integers, the similarity of the sets is defined to be Nc/Nt*100%, where Nc is the number of distinct common numbers shared by the two sets, and Nt is the to...
分类:其他好文   时间:2014-04-29 13:44:20    阅读次数:325
Leetcode:Container with most water 最大蓄水量
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Fin...
分类:其他好文   时间:2014-04-29 13:15:21    阅读次数:415
Leetcode:Add Binary 二进制相加
Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". 思路同十进制的大数相加。代码如下: class Solution { public: string addBinary(string a, str...
分类:其他好文   时间:2014-04-29 13:12:20    阅读次数:328
hdu1211
RSA is one of the most powerful methods to encrypt data. The RSA algorithm is described as follow: > choose two large prime integer p, q > calculate n = p × q, calculate F(n) = (p - 1) × (q - 1) ...
分类:其他好文   时间:2014-04-27 21:37:59    阅读次数:315
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!