Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use the Lemple-Ziv-Welch (LZW) algorithm to encode the following ascii text: EEEEEEEEEE. Assume that the input (ascii) is 8 bits and the output encoding is

Use the Lemple-Ziv-Welch (LZW) algorithm to encode the following ascii text: "EEEEEEEEEE". Assume that the input (ascii) is 8 bits and the output encoding is 9 bits, so codes 256 to 511 may be used for strings. Show both the output and the entries in the string table. Show the output and calculate the % space savings. The code and an example are provided below.

image text in transcribed

Routine Lzw cOMPRESS 1. STRING get input character 2. WHILE there are still input characters DO CHARACTER-get input character IF STRING+CHARACTER is in the string table then STRING STRING character ELSE output the code for STRING add STRING+CHARACTER to the string table STRING CHARACTER 10. 11. END of WHILE 12. output the code for STRING END of IF Input String = /WED/WE/WEE/WEB/NET Character Input Code Output New code value New String 256 257 258 259 260 261 262 263 264 265 266 WE WE 256 WEE 260 261 257 E/W WEB B/ WET EB 260 Routine Lzw cOMPRESS 1. STRING get input character 2. WHILE there are still input characters DO CHARACTER-get input character IF STRING+CHARACTER is in the string table then STRING STRING character ELSE output the code for STRING add STRING+CHARACTER to the string table STRING CHARACTER 10. 11. END of WHILE 12. output the code for STRING END of IF Input String = /WED/WE/WEE/WEB/NET Character Input Code Output New code value New String 256 257 258 259 260 261 262 263 264 265 266 WE WE 256 WEE 260 261 257 E/W WEB B/ WET EB 260

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Luc Perkins, Eric Redmond, Jim Wilson

2nd Edition

1680502530, 978-1680502534

More Books

Students also viewed these Databases questions

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago