码迷,mamicode.com
首页 >  
搜索关键字:return array    ( 86705个结果
LeetCode: Single Number
Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime comple...
分类:其他好文   时间:2014-05-23 07:22:48    阅读次数:241
41.把数组排成最小的数
Sort array to min value.
分类:其他好文   时间:2014-05-21 21:03:34    阅读次数:262
【leetcode】Remove Duplicates from Sorted Array
Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space for a...
分类:其他好文   时间:2014-05-21 20:00:51    阅读次数:296
php利用新浪接口查询ip获取地理位置示例
desc)) { $loc = $location->province.$location->city.$location->district.$location->isp; }else{ $loc = $location->desc; } return $loc;}ec...
分类:Web程序   时间:2014-05-21 19:41:19    阅读次数:364
Best Time to Buy and Sell Stock III
Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a...
分类:其他好文   时间:2014-05-21 17:27:55    阅读次数:252
LeetCode: First Missing Positive [040]
【题目】 Given an unsorted integer array, find the first missing positive integer. For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2. Your algorithm should run in O(n) time and uses constant space. 【题意】 给定一个数组,找出第一个缺失的正数。时间复杂度O(n) ...
分类:其他好文   时间:2014-05-21 17:13:07    阅读次数:219
13周 项目1 点,圆的关系
#include #include using namespace std; class Point { public: Point(double a,double b):x(a),y(b) {} double getx() { return x; } double gety() { ...
分类:其他好文   时间:2014-05-21 14:44:07    阅读次数:281
LeetCode: Multiply Strings [042]
【题目】 Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large and are non-negative. 【题意】 给定用字符串表示的整数,返回两个数的乘积结果字符串。两个数字都非负,且能任意大。 【思路】 1. 考虑其中一个数是0的情况 2. 模拟乘法运算...
分类:其他好文   时间:2014-05-21 13:45:37    阅读次数:214
shell的内部命令和外部命令
shell命令分成内置命令和外部命令。 内置命令(builtin command) 是shell解释程序内建的,有shell直接执行,不需要派生新的进程。有一些内部命令可以用来改变当前的shell环境。 常见的内部命令有:.(点命令)、bg、cd、continue、echo、exec、exit、export、fg、jobs、pwd、read、return、set、shift、t...
分类:其他好文   时间:2014-05-21 13:33:24    阅读次数:213
Java 数组工具类排序,最大值最小值等
public class ArrayUtils{ /** * 返回数组最大值 * * @param a * @return */ public static int max(int[] a){ // 返回数组最大值 int x; int aa[]=new int[a.leng...
分类:编程语言   时间:2014-05-21 13:31:26    阅读次数:373
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!