Free Sample
Get Answer : COMP9319 2019T2 Assignment 1: LZW Encoding and Decoding
Solution.pdfYour task in this assignment is to implement the original LZW encoder and decoder with 14-bit 16384 dictionary entries, called lencode and ldecode, in C/C++. After the dictionary is full, no new entries can be added. This assignment is to let you understand how LZW works, rather than to produce encoded files with reduced size. Therefore, the encoder will take input from the the standard input and output directly to the standard output. You may assume the input contains one or more visible ASCII characters (plus spaces and tabs). You may further assume that there is one and only one newline character at the end.
You do not need to encode this newline character and you should just treat it as EOF as shown in the examples below. To be able to decode and get back the identical file to the original file, make sure you also output one newline character accordingly at the end, as illustrated in the examples.
For example, %wagner> cat test.txt ^WED^WE^WEE^WEB^WET %wagner> cat test.txt | lencode ^ W E D 256 E 260 261 257 B 260 T %wagner> cat test.txt | lencode | ldecode > test.out %wagner> diff test.txt test.out %wagner>
You may assume that a space is used as the delimiter between the codewords. For instance, if there are three consecutive spaces between two codewords, the second space is a codeword itself and the other twos are delimiters. Similarly, the symbols that are digits can be easily distinguished from dictionary references: %wagner> cat numbers.txt 123123123 %wagner> cat numbers.txt | lencode 1 2 3 256 258 257 %wagner> You should submit totally two C or C++ files, one for encoding and one for decoding. Your submitted files will be compiled using the command depending on their file extensions: %wagner> gcc -o lencode lencode.c %wagner> gcc -o lencode ldecode.c or: %wagner> g++ -o lencode lencode.cpp %wagner> g++ -o lencode ldecode.cpp When a command argument -l is provided, a listing of its variables, output characters and dictionary entries (similar to the listing shown in Slides 100 and 103 of Lecture 1) are displayed to the standard output.
For example, using the same test.txt from the above: %wagner> lencode -l < test.txt NIL ^ ^ W ^ 256 ^W W E W 257 WE E D E 258 ED D ^ D 259 D^ ^ W
Get Unique assignment solution copy for LZW Encoding and Decoding assignment with myassignmentmart.com is the one of the experienced sites where you can get any time assignment help of all subjects. Our LZW Encoding and Decoding experts have experienced task composing specialists and can do short deadline assignments of any subjects. Our coding help specialists are accessible 24×7 for assignment help for US, UK and Australian clients. You can email us your any questions at info@myassignmentmart.com

Get Assignment Help Now...!
Subjects We Offer
- Engineering Assignment Help
- MATLAB Assignment Help
- Mechanical Engineering Assignment Help
- Civil Engineering Assignment Help
- Computer Science Assignment Help
- Electrical Engineering Assignment Help
- Electronics Assignment Help
- Economics Assignment Help
- Management Assignment Help
- Do My Assignment
- Cheap Assignment Help
- Programming Assignment Help
- Law Assignment Help
- Assignment Provider
- Finance Assignment Help
- Python Assignment help
- Healthcare Management Assignment Help
- Computer Network Assignment Help
- History Assignment Help
- Industrial Engineering Homework Help
- IT Management Assignment Help
- Nursing Assignment Help
- Operating System Assignment Help
- Statistics Assignment Help
- Material Science Assignment Help
- Mechanical Engineering Homework Help
- University Assignment Help
- Agriculture Engineering Homework Help
- ATHE Courses Assignment Help
- Capital Budgeting Assignment Help
- BTEC Assignment Help
- HND Assignment Help
- Material Science Assignment Help
- Psychology Assignment Help
- Resit Assignment Help
- Computer Architecture Assignment Help
- Data Structure Assignment Help
- Database Assignment Help
- PHP Assignment Help