码迷,mamicode.com
首页 >  
搜索关键字:array    ( 29504个结果
LeetCode-Longest Increasing Subsequence
Given an unsorted array of integers, find the length of longest increasing subsequence. For example, Given [10, 9, 2, 5, 3, 7, 101, 18], The longest i ...
分类:其他好文   时间:2016-08-01 10:24:06    阅读次数:140
Leetcode 260. Single Number III
260. Single Number III 260. Single Number III Total Accepted: 42076 Total Submissions: 91382 Difficulty: Medium Given an array of numbers nums, in whi ...
分类:其他好文   时间:2016-08-01 10:23:16    阅读次数:146
LeetCode-Increasing Triplet Subsequence
Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. Formally the function should: Your algorithm ...
分类:其他好文   时间:2016-08-01 10:22:02    阅读次数:152
【Leetcode解题报告】数组元素删除
Remove Element、 Remove Duplicates from Sorted Array、 Remove Duplicates from Sorted Array II、 Move Zeros ...
分类:编程语言   时间:2016-08-01 09:09:45    阅读次数:231
Java script数组遍历for与for in的区别
我们在学习js中遍历数组的有两种方式 代码: var array=['a']//标准的for循环for(var i=1;i<array.length;i++){ alert(array[i])}//foreach循环for(var i in array){ alert(array[i])} 正常情况 ...
分类:编程语言   时间:2016-08-01 01:47:45    阅读次数:1599
UVa 11536 Smallest Sub-Array (水题, 滑动窗口)
题意:给定 n 个由0~m-1的整数组成的序列,输入 k ,问你找出连续的最短序列,使得这个序列含有1-k的所有整数。 析:这个题,很简单么,只要从头开始扫一遍就OK,时间复杂度为O(n)。 代码如下: ...
分类:其他好文   时间:2016-08-01 01:39:29    阅读次数:134
【leetcode81】Product of Array Except Self
题目描述:给定一个长度为n的整数数组Array【】,输出一个等长的数组result【】,这个输出数组,对应位置i是除了Array【i】之外,其他的所有元素的乘积例如:given [1,2,3,4], return [24,12,8,6].要求:时间复杂度是o(n)原文描述:Given an array of n integers where n > 1, nums, return an array...
分类:其他好文   时间:2016-08-01 00:28:04    阅读次数:180
Leetcode 137. Single Number II
137. Single Number II Total Accepted: 91077 Total Submissions: 235653 Difficulty: Medium Given an array of integers, every element appears three times ...
分类:其他好文   时间:2016-08-01 00:01:59    阅读次数:274
344 reverse string
hello=olleh 字符串 逆序输出 -转化成数组 对换位置后 组成新的数组 JAVA: public class Solution { public String reverseString(String s){ char [] array = s.toCharArray();//将字符串对象 ...
分类:其他好文   时间:2016-07-31 23:54:19    阅读次数:187
php 冒泡排序 快速排序
$a=array('3','8','1','4','11','7'); print_r($a); $len = count($a); //从小到大 for($i=1;$i<$len;$i++) { for($j=$len-1;$j>=$i;$j--) if($a[$j]<$a[$j-1]) {//如 ...
分类:编程语言   时间:2016-07-31 22:08:05    阅读次数:170
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!