码迷,mamicode.com
首页 >  
搜索关键字:return array    ( 86705个结果
Leetcode | First Missing Positive
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 sho...
分类:其他好文   时间:2014-05-16 02:58:54    阅读次数:249
Best Time to Buy and Sell Stock I && II && III
题目1:Best Time to Buy and Sell Stock Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie,...
分类:其他好文   时间:2014-05-16 01:46:15    阅读次数:460
LeetCode Scramble String
class Solution {public: bool isScramble(string s1, string s2) { int len = s1.length(); if (len == 1 && s1[0] == s2[0]) return true; ...
分类:其他好文   时间:2014-05-16 00:38:48    阅读次数:317
java通过经纬度计算两个点的之间的距离的算法
通过两个点的经纬度计算距离从google maps的脚本里扒了段代码,没准啥时会用上。大家一块看看是怎么算的。private const double EARTH_RADIUS = 6378.137;private static double rad(double d){return d * Mat...
分类:编程语言   时间:2014-05-16 00:33:24    阅读次数:365
问题总结之多线程
今天跟同事讨论了一下多线程并发问题,为了验证自己的想法,写了如下代码: package com.zken.pkg; public class MultiThread implements Runnable { private String name; public String getName() { return name; } public void setName(Str...
分类:编程语言   时间:2014-05-15 23:28:01    阅读次数:492
asp.net 上传XML,txt 直接读取文件内容
if (GetUploadFileContent.PostedFile.InputStream.Length < 1) { Msg.Text = "请选择文件"; return; } string FileNam...
分类:Web程序   时间:2014-05-15 22:15:08    阅读次数:348
使用typedef语句定义数组类型
使用typedef语句定义数组类型1. 一维数组类型的定义格式typedef [];例如:(1) typedef int vector[10];(2) typedef char strings[80];(3) typedef short int array[N];第一条语句定义了一个元素类型为int...
分类:其他好文   时间:2014-05-15 22:13:17    阅读次数:244
提防toString递归问题
看这个代码: public class D { @Override public String toString() { return "obj:"+this; } public static void main(String[] args) { System.out.println(new D()); }...
分类:其他好文   时间:2014-05-15 20:18:38    阅读次数:277
H3C设备console口配置本地用户验证
很简单的一个问题,既然有人提到了,那我就在这里记录一下。<H3C>sysSystemView:returntoUserViewwithCtrl+Z.[H3C]local-useradmin[H3C-luser-admin]passwordcipher12345678Updatinguser(s)information,pleasewait....[H3C-luser-admin]service-typetelnetlevel3[H3C-lus..
分类:其他好文   时间:2014-05-15 19:06:36    阅读次数:294
html 前台通用表单
Document function validate() { if(loginform.username.value == ""){ alert("账号不能为空!"); return; } if(loginform.password.value == ""){ alert("密码不能为空!"); return; } loginform.submit...
分类:Web程序   时间:2014-05-15 18:39:01    阅读次数:501
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!