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
Arte-miy333 [17]
3 years ago
6

What is an optimal Huffman code for the following set of frequencies, based on the first 8 Fibonacci numbers?a:1 b:1 c:2 d:3 e:5

f:8 g:13 h:21a. Provide code tableb. Use the Huffman algorithm to build the treec. Generalize your answer to find the optimal code when the frequencies are the first n Fibonacci numbers.

Computers and Technology
1 answer:
frez [133]3 years ago
6 0

Answer:

Check the explanation

Explanation:

a) kindly check the below diagram for solutions to question <em><u>a</u></em>

b) The Huffman algorithm used to build the tree is as follows;

• Collect n initial Huffman trees, such that each is a single leaf node Create a priority queue and insert the n trees in the priority queue for frequency

• Now, pick the two nodes having the lowest queue, and join them to form the tree such that the root of the tree has two nodes. The weight of the tree is the sum of the weight of the two data nodes

• insert the new tree in the priority queue

• Repeat the above steps until all the nodes have been combined into one tree

c) kindly check the below image for solutions to question <em><u>c</u></em>

You might be interested in
How do I write a program in Pascal that finds the index of the minimum number of an array(using Function) and replaces it to a n
nordsb [41]

Answer:

program arraysminfinder;

procedure minreplace();

var

no: array [1..10] of integer;  (*no is an array of integers, 10 in all *)

a: integer= 0;

i: integer= 0;

c: integer= 0;

k: integer=0;

N: integer=0;

begin

(* We need to first initialize the array no with 0 values *)

for a := 1 to 10 do

no[a]:=0;

c:=no[1];

for a := 1 to 10 do

begin

  if (no[i]<c) then

  begin

   c:=no[i];

   k:=i;

  end

  else

  begin

      i:=i+1;

  end

 end;

  writeln('Enter the new number:');

  read(N);

  no[k]:=N;

  for a := 1 to 10 do

  begin

     writeln('The array elements are:',no[a]);

   end;

end;

begin

end.

Explanation:

The program is as above.  I have used a function, a for loop, an array of integers, and the if then else ladder for getting the desired output as mentioned in the program. If in case you want procedure for input and output, create a procedure like:

procedure replacenum():integer;

Begin

 writeln("Enter the new number:" N);

    no[k]:=N;

   for a := 1 to 10 do

         writeln("The array elements are:"no[a]);

 end.

Similarly you can make a procedure for input.

5 0
4 years ago
What do you need to do in order get paid for ads running on your content?
OverLord2011 [107]
If you're talking about YouTube or platforms like that, you have to monetize your videos in the settings. However, if your video contains copyrighted content, you will most likely be banned or given a strike for copyright infringement. You can monetize videos that have absolutely no copyrighted music, pictures or videos
4 0
3 years ago
In what two ways can you reset your workspace in photoshop adobe 2020?
kati45 [8]

Answer:

right click 3 down press restart

Explanation:

7 0
3 years ago
Round 74,361 to the nearest 10​
grandymaker [24]

Answer:

74,400 i think

Explanation:

8 0
3 years ago
___________________ has made the education process more effective and productive.
OlgaM077 [116]

I'm thinking <u>technology</u> maybe?

4 0
2 years ago
Read 2 more answers
Other questions:
  • A video streaming website uses 32 bit integers to count the number of times each video is played. In anticipation of some videos
    14·2 answers
  • When considering the best technology for its particular use what should a business consider
    8·2 answers
  • Sukhi needs to insert a container into her form to collect a particular type of information. Which object should she insert?
    6·1 answer
  • Describe the GRANT statement and explain how it relates to security. What types of privileges may be granted? How are they revok
    15·1 answer
  • The Classic Triangle Testing Problem, (Myer's Triangle): A program reads three integer values. The three values are interpreted
    10·1 answer
  • What occurs when a website can know enough about a person's likes and dislikes that it can fashion offers that are more likely t
    9·1 answer
  • 52. Which of the following numbering system is used by the computer to display numbers? A. Binary B. Octal C. Decimal D. Hexadec
    12·2 answers
  • When attaching a file or files in outlook 365 you select the attach command and then select the files location
    5·1 answer
  • HELP!!!!!
    15·1 answer
  • Is it true that if the user log out the computer will turn off automatically​
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!