码迷,mamicode.com
首页 >  
搜索关键字:arrays values    ( 12125个结果
第八章 线性时间排序 8.3 基数排序
package chap08_Linear_Time_Sort;import static org.junit.Assert.*;import java.util.Arrays;import org.junit.Test;public class CopyOfSortAlgorithms { /**...
分类:其他好文   时间:2014-06-12 20:32:16    阅读次数:231
Effective Java实作Comparable - 就是爱Java
当集合或数组内的对象需要排序时,会利用Collections.sort或Arrays.sort来进行排序,通常会implement Comparable,来实现自定义排序,透过回传值来表示排序的大小。
分类:编程语言   时间:2014-06-12 19:33:37    阅读次数:239
[LeetCode] Merge Sorted Array [22]
题目: Given two sorted integer arrays A and B, merge B into A as one sorted array. 原题链接(点我) 解题思路: 合并两个数组为一个有序数组,这题也很简单,唯一考查的地方就是怎么处理数组,是从前往后还是从后往前。一般情况,从后往前的效率比从前往后高,也要省不少事。代码如下,从后开始合并。 代码实现:...
分类:其他好文   时间:2014-06-11 00:37:42    阅读次数:314
【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...
分类:其他好文   时间:2014-06-10 20:44:02    阅读次数:298
【leetcode】Gray Code
The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the total number...
分类:其他好文   时间:2014-06-10 19:38:39    阅读次数:199
第六章 堆排序 6.5 优先队列
package chap06_Heap_Sort;import static org.junit.Assert.*;import java.util.ArrayList;import java.util.Arrays;import org.junit.Test;/** * 优先队列,二叉堆数组实现,...
分类:其他好文   时间:2014-06-10 16:40:14    阅读次数:347
第六章 堆排序
以后尽量能用迭代就别用递归啊,递归只是让自己轻松了,但是却增加了电脑的负担。 package chap06_Heap_Sort;import static org.junit.Assert.*;import java.util.Arrays;import org.junit.Test;public ...
分类:其他好文   时间:2014-06-10 11:57:27    阅读次数:252
用程序读取CSV文件的方法
CSV全称 Comma Separated values,是一种用来存储数据的纯文本文件格式,通常用于电子表格或数据库软件。用Excel或者Numbers都可以导出CSV格式的数据。CSV文件的规则0 开头是不留空,以行为单位。 1 可含或不含列名,含列名则居文件第一行。2 一行数据不垮行,无空行....
分类:其他好文   时间:2014-06-10 10:03:30    阅读次数:204
C++ 异步 IO(三) 异步IO
The oldest solution that people still use for this problem is select(). The select() call takes three sets of fds (implemented as bit arrays): one for...
分类:编程语言   时间:2014-06-10 08:26:42    阅读次数:325
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!