COMPUTER NETWORKING

MULTIMEDIA AND QUALITY OF SERVICE

COMPRESSION

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
I write a poem 100 characters long. I compress this to a string that is 30 characters long and a “key” that is 10 characters long. What is my % compression?
A
30%
B
40%
C
70%
D
60%
Explanation: 

Detailed explanation-1: -Deflator is one of most used class for string compression in java. It uses the popular ZLIB compression library. It provides the function called deflator() to compress string. The function first takes the input string data, performs the compression and then fills the given buffer with the compressed data.

Detailed explanation-2: -In Python 3, If you change text to a string, compressed = zlib. compress(text) should be compressed = zlib. compress(text. encode()) .

Detailed explanation-3: -res := blank string. cnt := 1. for i in range 1 to size of s-1, do. if s[i-1] is same as s[i], then. cnt := cnt + 1. otherwise, res := res concatenate s[i-1] if cnt > 1, then. res := res + last character of s. if cnt > 1, then. res := res concatenate cnt. return res. 12-Oct-2021

There is 1 question to complete.