Here you can find the source of removeDuplicates(double[] array)
public static double[] removeDuplicates(double[] array)
//package com.java2s; //License from project: Apache License import java.util.HashMap; import java.util.Map; public class Main { public static double[] removeDuplicates(double[] array) { double[] result = null; Map<Double, Object> values = new HashMap<Double, Object>(array.length); for (double value : array) values.put(value, new Object()); {//from www . j a v a 2 s . com int i = 0; result = new double[values.size()]; for (double value : values.keySet()) result[i++] = value; } return result; } }