File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
src/main/java/com/thealgorithms/compression Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 99
1010public 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 ;
Original file line number Diff line number Diff line change 11package 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.
912
1013public 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+ }
You can’t perform that action at this time.
0 commit comments