Use the tree to encode "day". Use the tree to encode "candy". Use the tree to decode "1110101101". Use the tree to decode "111001101110010".

Advanced Engineering Mathematics
10th Edition
ISBN:9780470458365
Author:Erwin Kreyszig
Publisher:Erwin Kreyszig
Chapter2: Second-order Linear Odes
Section: Chapter Questions
Problem 1RQ
icon
Related questions
Question
**Transcription and Explanation for Educational Use**

---

**Consider the following tree for a prefix code:**

[Image of a binary tree]

- Top vertex (root) branches into:
  - Left (0): character 'a'
  - Right (1): Next level vertex

- Second-level vertex (1) branches into:
  - Left (0): character 'o'
  - Right (1): Next level vertex

- Third-level vertex (1) branches into:
  - Left (0): Next level vertex
  - Right (1): character 'e'

- Fourth-level left vertex (0) branches into:
  - Left (0): character 'c'
  - Right (1): character 'n'

- Fourth-level right vertex (1) branches into:
  - Left (0): character 'd'
  - Right (1): character 'y'

**Figure 13:**

- A tree with 5 vertices.
- The top vertex branches into character 'a' on the left and another vertex on the right.
- The second-level vertex branches into 'o' on the left and another vertex on the right.
- The third-level vertex branches into two vertices:
  - Left vertex in the fourth level: branches into 'c' on the left and 'n' on the right.
  - Right vertex in the fourth level: branches into 'd' on the left and 'y' on the right.
- Weight of each edge branching left from a vertex is 0.
- Weight of each edge branching right from a vertex is 1.

**Exercises:**

1. **Use the tree to encode “day”:**
   - 'd' = 110
   - 'a' = 0
   - 'y' = 111
   - **Encoded: 1100111**

2. **Use the tree to encode “candy”:**
   - 'c' = 1100
   - 'a' = 0
   - 'n' = 1101
   - 'd' = 110
   - 'y' = 111
   - **Encoded: 110001101110111**

3. **Use the tree to decode “1110101101”:**
   - 1 (right) -> 1 (right) -> 1 (right) -> 'e'
   - 0 (left) -> 'a'
   - 1 (
Transcribed Image Text:**Transcription and Explanation for Educational Use** --- **Consider the following tree for a prefix code:** [Image of a binary tree] - Top vertex (root) branches into: - Left (0): character 'a' - Right (1): Next level vertex - Second-level vertex (1) branches into: - Left (0): character 'o' - Right (1): Next level vertex - Third-level vertex (1) branches into: - Left (0): Next level vertex - Right (1): character 'e' - Fourth-level left vertex (0) branches into: - Left (0): character 'c' - Right (1): character 'n' - Fourth-level right vertex (1) branches into: - Left (0): character 'd' - Right (1): character 'y' **Figure 13:** - A tree with 5 vertices. - The top vertex branches into character 'a' on the left and another vertex on the right. - The second-level vertex branches into 'o' on the left and another vertex on the right. - The third-level vertex branches into two vertices: - Left vertex in the fourth level: branches into 'c' on the left and 'n' on the right. - Right vertex in the fourth level: branches into 'd' on the left and 'y' on the right. - Weight of each edge branching left from a vertex is 0. - Weight of each edge branching right from a vertex is 1. **Exercises:** 1. **Use the tree to encode “day”:** - 'd' = 110 - 'a' = 0 - 'y' = 111 - **Encoded: 1100111** 2. **Use the tree to encode “candy”:** - 'c' = 1100 - 'a' = 0 - 'n' = 1101 - 'd' = 110 - 'y' = 111 - **Encoded: 110001101110111** 3. **Use the tree to decode “1110101101”:** - 1 (right) -> 1 (right) -> 1 (right) -> 'e' - 0 (left) -> 'a' - 1 (
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 7 steps with 1 images

Blurred answer
Recommended textbooks for you
Advanced Engineering Mathematics
Advanced Engineering Mathematics
Advanced Math
ISBN:
9780470458365
Author:
Erwin Kreyszig
Publisher:
Wiley, John & Sons, Incorporated
Numerical Methods for Engineers
Numerical Methods for Engineers
Advanced Math
ISBN:
9780073397924
Author:
Steven C. Chapra Dr., Raymond P. Canale
Publisher:
McGraw-Hill Education
Introductory Mathematics for Engineering Applicat…
Introductory Mathematics for Engineering Applicat…
Advanced Math
ISBN:
9781118141809
Author:
Nathan Klingbeil
Publisher:
WILEY
Mathematics For Machine Technology
Mathematics For Machine Technology
Advanced Math
ISBN:
9781337798310
Author:
Peterson, John.
Publisher:
Cengage Learning,
Basic Technical Mathematics
Basic Technical Mathematics
Advanced Math
ISBN:
9780134437705
Author:
Washington
Publisher:
PEARSON
Topology
Topology
Advanced Math
ISBN:
9780134689517
Author:
Munkres, James R.
Publisher:
Pearson,