This commit is contained in:
2024-12-31 21:07:05 -05:00
parent 9f5b75c782
commit bc72a32f7c
3 changed files with 7 additions and 24 deletions

View File

@@ -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;

View File

@@ -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>

View File

@@ -5,14 +5,8 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>