package math.stat;

import math.utils.ArrayUtil;
import math.utils.FrequencyMap;
import math.utils.Tuple2L;

import java.util.Arrays;

public class Stat01 {
    public static void main(String[] args) {
        int[] tabl = ArrayUtil.clone(StatUtil.dlugoscF);
        Arrays.sort(tabl);
        FrequencyMap<Long> array = new FrequencyMap<>();
        Tuple2L[] tabl1;
        for (int i : tabl) {
            array.add((long) i);
        }
        tabl1 = array.getAllAsTuplesL();
        System.out.println("Długość w cm   Liczebność");
        for (Tuple2L tuple2L : tabl1) {
            System.out.println("   " + tuple2L.getX() + "              " + tuple2L.getY());
        }
        System.out.println("Razem:            " + tabl1.length);
    }
}
