Sample Output of Program: Welcome to Text/Huffman Code Conversion Choose below (Enter Numbers Only) 1. Text to Huffman Code 2. Huffman Code to Text 3. Exit 1 --Text to Huffman Code-- Enter a text: abc Huffman code: 01001100 Would you like to convert again? (Y/N) y Choose below (Enter Numbers Only) 1. Text to Huffman Code 2. Huffman Code to Text 3. Exit 2 --Huffman Code to Text- Enter a Huffman Code: 000100101 Text: hed Would you like to convert again? (Y/N) Y Choose below (Enter Numbers Only) 1. Text to Huffman Code 2. Huffman Code to Text 3. Exit 3 Process finished with exit code 0

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

This is the Java code that needs to be edited.

 

import java.util.*;
public class BTNode<T> {
private T element;
private BTNode<T> left;
private BTNode<T> right;
/**Constructs a binary tree node that stores the specified element. */
public BTNode(T element) {
this.element = element;
left = right = null;
}
/** Returns the element stored in this node. */
public T getElement() {
return element;
}
/** Sets the element stored in this node.*/
public void setElement (T element) {
this.element = element;
}
/** Returns the left subtree of this node.*/
public BTNode<T> getLeft() {
return left;
}
/** Sets the left child of this node. */
public void setLeft (BTNode<T> left) {
this.left = left;
}
/** Returns the right subtree of this node. */
public BTNode<T> getRight() {
return right;
}
/**Sets the right child of this node. */
public void setRight (BTNode<T> right) {
this.right = right;
}
//...
} // end of class

Sample Output of Program:
Welcome to Text/Huffman Code Conversion
Choose below (Enter Numbers Only)
1. Text to Huffman Code
2. Huffman Code to Text
3. Exit
1
--Text to Huffman Code--
Enter a text: abc
Huffman code: 01001100
Would you like to convert again? (Y/N)
y
Choose below (Enter Numbers Only)
1. Text to Huffman Code
2. Huffman Code to Text
3. Exit
2
--Huffman Code to Text-
Enter a Huffman Code: 000100101
Text: hed
Would you like to convert again? (Y/N)
Y
Choose below (Enter Numbers Only)
1. Text to Huffman Code
2. Huffman Code to Text
3. Exit
3
Process finished with exit code 0
Transcribed Image Text:Sample Output of Program: Welcome to Text/Huffman Code Conversion Choose below (Enter Numbers Only) 1. Text to Huffman Code 2. Huffman Code to Text 3. Exit 1 --Text to Huffman Code-- Enter a text: abc Huffman code: 01001100 Would you like to convert again? (Y/N) y Choose below (Enter Numbers Only) 1. Text to Huffman Code 2. Huffman Code to Text 3. Exit 2 --Huffman Code to Text- Enter a Huffman Code: 000100101 Text: hed Would you like to convert again? (Y/N) Y Choose below (Enter Numbers Only) 1. Text to Huffman Code 2. Huffman Code to Text 3. Exit 3 Process finished with exit code 0
Java Programming - Tree Data Structures
Please help me with this!
*Console-based program
Create a program that allows the user to this:
TO DO:
A. Input a text that will be converted to Huffman code.
- Output an error message if the text cannot be converted (e.g., using character/s in
the input text that is/are not part of the table Huffman codes).
B. Input a Huffman code that will be converted to its equivalent text.
- Output an error message if the input cannot be converted.
C. Output the Huffman Tree - (BONUS)
D. Use the Binary Tree Node Provided below
Transcribed Image Text:Java Programming - Tree Data Structures Please help me with this! *Console-based program Create a program that allows the user to this: TO DO: A. Input a text that will be converted to Huffman code. - Output an error message if the text cannot be converted (e.g., using character/s in the input text that is/are not part of the table Huffman codes). B. Input a Huffman code that will be converted to its equivalent text. - Output an error message if the input cannot be converted. C. Output the Huffman Tree - (BONUS) D. Use the Binary Tree Node Provided below
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY