You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've made a fix for quadratic time caused by substring() in LZW compression. The key to the fix is to use a new overloaded method TST.longestPrefixOf(String query, int startIndex) in LZW.compress() method. Attached please find 3 reference files:
LempelZivWelch.java: improved LZW.java
TernarySearchTrie: improved TST.java
lzw.sh: shell script proves the correctness and performance improvement.
NOTE: existing LZW seems to take forever to compress dickens.txt (~29MB)
Hi Kevin,
I've made a fix for quadratic time caused by substring() in LZW compression. The key to the fix is to use a new overloaded method TST.longestPrefixOf(String query, int startIndex) in LZW.compress() method. Attached please find 3 reference files:
LempelZivWelch.java: improved LZW.java
TernarySearchTrie: improved TST.java
lzw.sh: shell script proves the correctness and performance improvement.
NOTE: existing LZW seems to take forever to compress dickens.txt (~29MB)
Regards,
Donghao
LZW_fix.zip
The text was updated successfully, but these errors were encountered: