Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Using the symbols \({\bf{0, 1, and 2}}\) use ternary \(\left( {{\bf{m = 3}}} \right)\)Huffman coding to encode these letters with the givenfrequencies: \({\bf{A:0}}{\bf{.25, E:0}}{\bf{.30, N:0}}{\bf{.10, R:0}}{\bf{.05, T:0}}{\bf{.12, Z:0}}{\bf{.18}}\).

Short Answer

Expert verified

Letters have the following codes:

A - 2

E - 1

N - 010

R - 011

T - 02

Z - 00

Step by step solution

01

Step 1:Given symbols and their frequencies, our goal is to construct a rooted binary tree where the symbols are the labels of the leaves

The algorithm begins with a forest of trees each consisting of one vertex, where each vertex has a symbol as its label and where the weight of this vertex equals the frequency of the symbol that is its label.

02

Step2:One shall find code of the following letters with given frequencies using three symbols

Given that,\({\bf{A :0}}{\bf{.25, E:0}}{\bf{.30, N :0}}{\bf{.10, R :0}}{\bf{.05, T:0}}{\bf{.12, Z:0}}{\bf{.18}}{\bf{.}}\)

Since,the expression is\(\left( {{\bf{N - 1 mod m - 1}}} \right){\bf{ + 1 = 2}}\).

Firstly, constructs one tree with two least weighted vertices and in following steps, 3 least weighted components are combined together to form a tree.

03

The codes for the letters

So, the codes for the letters are as follows as per the explanation provided in the:

A - 2

E - 1

N - 010

R - 011

T - 02

Z - 00

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Show that postorder traversals of these two ordered rooted trees produce the same list of vertices. Note that this does not contradict the statement in Exercise 27, because the numbers of children of internal vertices in the two ordered rooted trees differ.

Well-formed formulae in prefix notation over a set of symbols and a set of binary operators are defined recursively by these rules:

  1. If x is a symbol, then x is a well-formed formula in prefix notation;
  2. If X and Y are well-formed formulae and * is an operator, then * XY is a well-formed formula.

a) Define a rooted tree and the root of such a tree.

b) Define the parent of a vertex and a child of a vertex in a rooted tree.

c) What are an internal vertex, a leaf, and a subtree in a rooted tree\(?\)

d) Draw a rooted tree with at least \({\bf{10}}\) vertices, where the degree of each vertex does not exceed \({\bf{3}}\). Identify the root, the parent of each vertex, the children of each vertex, the internal vertices, and the leaves.

Show that a tree has either one center or two centers that are adjacent.

a) Define pre-order, in-order, and post-order tree traversal.

b) Give an example of pre-order, post-order, and in-order traversal of a binary tree of your choice with at least \(12\) vertices.

Suppose that the computer network connecting the cities in Figure \({\bf{1}}\) must contain a direct link between New York and Denver. What other links should be included so that there is a link between every two computer centers and the cost is minimized?

See all solutions

Recommended explanations on Math Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free