码迷,mamicode.com
首页 >  
搜索关键字:Arrays    ( 3585个结果
后缀数组
后缀数组由 Manber & Myers 在 1990 年首先提出《Suffix arrays: a new method for on-line string searches》,用以替代后缀树,并且改进了存储空间的需求。后缀数组可以通过对后缀树做深度优先遍历(DFT: Depth First T...
分类:编程语言   时间:2014-10-30 18:46:00    阅读次数:311
TwoSum:两数相加得0
在一个不重复的数组中,统计有多少组两个元素相加得0。这里使用三种方式实现,并统计他们各自花费的时间:import java.util.Arrays;import java.util.HashMap;import java.util.Random;public class TwoSum { priva...
分类:其他好文   时间:2014-10-30 01:47:27    阅读次数:206
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 be O(log (m+n)). 题意:寻找两个有序数组的中位数,要求复杂度为O(log (m+...
分类:其他好文   时间:2014-10-29 22:23:33    阅读次数:226
Merge Sorted Array 混合插入有序数组
Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal...
分类:编程语言   时间:2014-10-29 16:22:58    阅读次数:209
LeetCode Merge Sorted Array
Given two sorted integer arrays A and B, merge B into A as one sorted array. Note: You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from B...
分类:其他好文   时间:2014-10-29 14:59:27    阅读次数:180
android中获取string字符串的方法
比如在arrays.xml里: Reboot Recovery BootLoader 在代码里获取:String item0 =this.getResources().getStringArray(R.array.reboot_item)[0];String item1 = this.getRes....
分类:移动开发   时间:2014-10-29 12:24:20    阅读次数:154
【Java基础】可变参数
下面是一个简单的小程序: 1 import java.util.Arrays; 2 3 class lesson6 4 { 5 public static void main(String[] args) 6 { 7 int array[]={2,3,1,5,...
分类:编程语言   时间:2014-10-29 01:41:54    阅读次数:206
万以内的字符串整数变成汉子字符串
import java.util.Arrays;import java.util.Scanner;public class Num2Rmb{ private String[] hanArr = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒...
分类:其他好文   时间:2014-10-28 23:54:06    阅读次数:245
Looping through the contents of an array
In this lesson, you'll learn to use the foreach loop, which is designed to handle arrays and certain types of PHP objects. The foreach loop can be use...
分类:其他好文   时间:2014-10-28 15:26:50    阅读次数:236
算法:快速排序
快速排序算法原理:见上图描述。 代码如下: package com.huan; import java.util.Arrays; import java.util.Random; public class QuickSort { public static void main(String[] args) { int[] data = new int[10]; for (int ...
分类:编程语言   时间:2014-10-28 12:18:05    阅读次数:249
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!