Things.
This commit is contained in:
@@ -2,6 +2,7 @@ package huffman_coding;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
import tester.Tester;
|
||||
|
||||
class Examples {
|
||||
@@ -41,13 +42,13 @@ class Huffman {
|
||||
ArrayList<Integer> freqs; // Frequencies of characters.
|
||||
|
||||
Huffman(ArrayList<String> charset, ArrayList<Integer> freqs) {
|
||||
if (charset.size() != freqs.size()) throw new IllegalArgumentException(
|
||||
"Character set must match frequencies."
|
||||
);
|
||||
if (charset.size() != freqs.size())
|
||||
throw new IllegalArgumentException(
|
||||
"Character set must match frequencies.");
|
||||
|
||||
if (charset.size() < 2) throw new IllegalArgumentException(
|
||||
"Character set too small."
|
||||
);
|
||||
if (charset.size() < 2)
|
||||
throw new IllegalArgumentException(
|
||||
"Character set too small.");
|
||||
|
||||
this.charset = charset;
|
||||
this.freqs = freqs;
|
||||
|
Reference in New Issue
Block a user