Skip to content

Commit a3c90f6

Browse files
committed
Fix checkstyle issues in LZW and ArithmeticCoding classes
1 parent 5106e6b commit a3c90f6

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/main/java/com/thealgorithms/compression/ArithmeticCoding.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010
public class ArithmeticCoding {
1111

12+
private ArithmeticCoding() {
13+
throw new UnsupportedOperationException("Utility class");
14+
}
15+
1216
public static double encode(String input, Map<Character, Double> probabilities) {
1317
double low = 0.0;
1418
double high = 1.0;

src/main/java/com/thealgorithms/compression/LZW.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package com.thealgorithms.compression;
22

3-
import java.util.*;
3+
import java.util.ArrayList;
4+
import java.util.HashMap;
5+
import java.util.List;
6+
import java.util.Map;
47

58
/**
69
* Implementation of LZW (Lempel–Ziv–Welch) compression algorithm.
@@ -9,6 +12,10 @@
912

1013
public class LZW {
1114

15+
private LZW() {
16+
throw new UnsupportedOperationException("Utility class");
17+
}
18+
1219
public static List<Integer> compress(String input) {
1320
int dictSize = 256;
1421
Map<String, Integer> dictionary = new HashMap<>();
@@ -36,4 +43,4 @@ public static List<Integer> compress(String input) {
3643

3744
return result;
3845
}
39-
}
46+
}

0 commit comments

Comments
 (0)