Skip to content

Commit 5106e6b

Browse files
committed
Add LZW and Arithmetic Coding algorithms in compression category
1 parent 9d34b4b commit 5106e6b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
import java.util.Map;
44

5+
/**
6+
* Implementation of Arithmetic Coding algorithm.
7+
* Reference: https://en.wikipedia.org/wiki/Arithmetic_coding
8+
*/
9+
510
public class ArithmeticCoding {
611

712
public static double encode(String input, Map<Character, Double> probabilities) {

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
import java.util.*;
44

5+
/**
6+
* Implementation of LZW (Lempel–Ziv–Welch) compression algorithm.
7+
* Reference: https://en.wikipedia.org/wiki/Lempel–Ziv–Welch
8+
*/
9+
510
public class LZW {
611

712
public static List<Integer> compress(String input) {

0 commit comments

Comments
 (0)