Things.
This commit is contained in:
@@ -2,6 +2,7 @@ package huffman_coding;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
import tester.Tester;
|
import tester.Tester;
|
||||||
|
|
||||||
class Examples {
|
class Examples {
|
||||||
@@ -41,13 +42,13 @@ class Huffman {
|
|||||||
ArrayList<Integer> freqs; // Frequencies of characters.
|
ArrayList<Integer> freqs; // Frequencies of characters.
|
||||||
|
|
||||||
Huffman(ArrayList<String> charset, ArrayList<Integer> freqs) {
|
Huffman(ArrayList<String> charset, ArrayList<Integer> freqs) {
|
||||||
if (charset.size() != freqs.size()) throw new IllegalArgumentException(
|
if (charset.size() != freqs.size())
|
||||||
"Character set must match frequencies."
|
throw new IllegalArgumentException(
|
||||||
);
|
"Character set must match frequencies.");
|
||||||
|
|
||||||
if (charset.size() < 2) throw new IllegalArgumentException(
|
if (charset.size() < 2)
|
||||||
"Character set too small."
|
throw new IllegalArgumentException(
|
||||||
);
|
"Character set too small.");
|
||||||
|
|
||||||
this.charset = charset;
|
this.charset = charset;
|
||||||
this.freqs = freqs;
|
this.freqs = freqs;
|
||||||
|
@@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<classpath>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21">
|
|
||||||
<attributes>
|
|
||||||
<attribute name="module" value="true"/>
|
|
||||||
</attributes>
|
|
||||||
</classpathentry>
|
|
||||||
<classpathentry kind="src" path="src"/>
|
|
||||||
<classpathentry kind="lib" path="/home/jacob/Projects/CS3/libs/javalib.jar"/>
|
|
||||||
<classpathentry kind="lib" path="/home/jacob/Projects/CS3/libs/tester.jar"/>
|
|
||||||
<classpathentry kind="output" path="bin"/>
|
|
||||||
</classpath>
|
|
@@ -5,14 +5,8 @@
|
|||||||
<projects>
|
<projects>
|
||||||
</projects>
|
</projects>
|
||||||
<buildSpec>
|
<buildSpec>
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
</buildSpec>
|
</buildSpec>
|
||||||
<natures>
|
<natures>
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
|
||||||
</natures>
|
</natures>
|
||||||
<filteredResources>
|
<filteredResources>
|
||||||
<filter>
|
<filter>
|
||||||
|
Reference in New Issue
Block a user