1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Nonamiya [84]
2 years ago
8

g Suppose we want to compress a text consisting of 6 characters,a, b, c, d, e, fusingthe Huffman Algorithm. Give an example for

which the algorithm produces at least onecodeword of length 5. In other words, you are being asked to give a set of the characterfrequencies that results in the deepest tree.

Computers and Technology
1 answer:
Papessa [141]2 years ago
3 0

Answer:

e(a) = 0

e(b) = 10

e(c) = 110

e(d) = 1110

Explanation:

The Worst case will happen when f(a) > 2*f(b) ; f(b) > 2*f(c) ; f(c) > 2*f(d) ; f(d) > 2*f(e) and f(e) > 2*f(f).

Where f(x) is frequency of character x.

Lets consider the scenario when

f(a) = 0.555, f(b) = 0.25, f(c) = 0.12, f(d) = 0.05, f(e) = 0.02 and f(f) = 0.005

Please see attachment for image showing the steps of construction of Huffman tree:- see attachment

From the Huffman tree created, we can see that endcoding e() of each character are as follows:-

e(a) = 0

e(b) = 10

e(c) = 110

e(d) = 1110

e(e) = 11110

e(f) = 11111

So we can see that maximum length of encoding is 5 in this case.

You might be interested in
Why are high-quality transformers wound with large diameter wire?
lesya692 [45]
So that they can lower the I2R losses
8 0
3 years ago
Djdjdjdjdjdjdjdjdjjdjdjdjdjdjdjdjdjdjdj
DanielleElmas [232]
Shorty a bad bleep .
7 0
2 years ago
Read 2 more answers
“What does it mean when we “rework” copyrighted material?”
Alja [10]
We use ideas and thoughts that have already been protected by the law which is called Copyright. We reworking copyright material means we are taking somebody's ideas and calling it ours. Which is not right by the law.
3 0
3 years ago
Read 2 more answers
Suppose you are provided with 2 strings to your program. Your task is to join the strings together so you get a single string wi
Mariulka [41]

Answer:

public class TestImport{

   public static void main(String[] args) {

       String string1 = args[1];

       String string2 = args[2];

       System.out.println(string1 +" " +string2);

   }

}

Explanation:

The solution here is to use string concatenation as has been used in this statement System.out.println(string1 +" " +string2);

When this code is run from the command line and passed atleast three command line arguments for index 0,1,2 respectively, the print statment will return the second string (that is index1) and the third argument(that is index2) with a space in-between the two string.

6 0
2 years ago
Which of the following can technology NOT do?
Gnesinka [82]

make our life problem free

because technology has its negative effects on humanity like Social media and screen time can be bad for mental health

And technology is leading us to sedentary lifestyles

Technology is addictive

Insomnia can be another side effect of digital devices

Instant access to information makes us less self-sufficient

Young people are losing the ability to interact face-to-face

Social media and screen time can be bad for mental health

Young people are losing the ability to interact face-to-face

Relationships can be harmed by too much tech use

4 0
3 years ago
Other questions:
  • Which of the following statements is true?
    6·1 answer
  • Holly Carpenter argues that technology may actually prevent some kinds of evolution that would benefit humans. Do you agree with
    8·2 answers
  • Design and implement a class Country that stores the name of the country, its population, its area, and the population density (
    6·1 answer
  • ) Suppose algorithm A takes 10 seconds to handle a data set of 1000 records. Suppose the algorithm A is of complexity O(n2). Ans
    12·1 answer
  • What is the basic difference between a printer and a plotter?​
    12·1 answer
  • Advertising is organized around four distinct groups. The _____ group includes the photographers, the illustrators, video produc
    9·1 answer
  • 1. Do our shared social experiences lead us to think<br><br> communication is a cure-all?
    13·1 answer
  • Does anyone know 7.1.3: Firework karel?
    5·1 answer
  • Priortization is an example of a skill that helps you reach long term goals because
    14·1 answer
  • Array bounds checking should be directly coded into a system rather than assumed.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!