Write a program that enables the user to enter text and displays the Huffman coding tree based
Question:
Write a program that enables the user to enter text and displays the Huffman coding tree based on the text, as shown in Figure 25.25a. Display the weight of the subtree inside the subtree?s root circle. Display each leaf node?s character. Display the encoded bits for the text in a label. When the user clicks the Decode Text button, a bit string is decoded into text displayed in the label, as shown in Figure 25.25b.
Transcribed Image Text:
Welcome Show Huffman Tree Enter a text: Enter a bit string: Decode to Text 7.0 4.0 3.0 2.0 2.0 2.0 1.0 1.0 1.0 1.0 1.0 m Welcome is encoded to 110100111110001010 (a) Enter a text: Show Huffman Tree Enter a bit string: 00010011101101i1 Decode to Text 7.0 3.0 4.0 1.0 2.0 2.0 2.0 1.0 1.0 1.0 1.0 m 0001001110110111 is decoded to omleWc (b)
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 53% (13 reviews)
Program Plan Create a TreePane class that extends to Pane class Create constructors getters and setters for this Class which creates a new Tree Create method displayTree which draws circles and puts v...View the full answer
Answered By
Aysha Ali
my name is ayesha ali. i have done my matriculation in science topics with a+ . then i got admission in the field of computer science and technology in punjab college, lahore. i have passed my final examination of college with a+ also. after that, i got admission in the biggest university of pakistan which is university of the punjab. i am studying business and information technology in my university. i always stand first in my class. i am very brilliant client. my experts always appreciate my work. my projects are very popular in my university because i always complete my work with extreme devotion. i have a great knowledge about all major science topics. science topics always remain my favorite topics. i am also a home expert. i teach many clients at my home ranging from pre-school level to university level. my clients always show excellent result. i am expert in writing essays, reports, speeches, researches and all type of projects. i also have a vast knowledge about business, marketing, cost accounting and finance. i am also expert in making presentations on powerpoint and microsoft word. if you need any sort of help in any topic, please dont hesitate to consult with me. i will provide you the best work at a very reasonable price. i am quality oriented and i have 5 year experience in the following field.
matriculation in science topics; inter in computer science; bachelors in business and information technology
_embed src=http://www.clocklink.com/clocks/0018-orange.swf?timezone=usa_albany& width=200 height=200 wmode=transparent type=application/x-shockwave-flash_
4.40+
11+ Reviews
14+ Question Solved
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Question Posted:
Students also viewed these Computer science questions
-
Write a program that enables the user to specify the location and size of the rectangles and displays whether the two rectangles intersect, as shown in Figure 16.39b. Enable the user to point the...
-
Write a program that enables the user to specify the location and size of the circles and displays whether the two circles intersect, as shown in Figure 16.39a. Enable the user to point the mouse...
-
Write a program that enables the user to drag the vertices of a triangle and displays the angles dynamically as the triangle shape changes, as shown in Figure 15.30a. The formula to compute angles is...
-
What is the square root of 3 to the square root of 2 power times the square root of 3 to the negative square root of 2 power?
-
If S and T are subsets of a normed linear space with S closed and T compact then their sum S + T is closed.
-
To design a new advertising campaign, Volkswagen would like to estimate the proportion of drivers of the new VW Beetle who are women. In a random sample of 250 Beetle owners, 140 of them were women....
-
Why can we say that memory is highly functional but that it may not be perfectly suited to all situations? lo1
-
In May, Patricia Allen left her automobile on the shoulder of a road in the city of Erehwon after the car stopped running. A member of the Erehwon city police department came upon the car later that...
-
Wilber, Inc. manufactures model airplane kits and projects production at 150, 450, 500, and 700 kits for the next four quarters. (Click the icon to view the manufacturing information.) Prepare...
-
This free-body diagram shows three forces that act on a stone hanging at rest from two strings. a. Calculate the horizontal component of the tension in each string. State why these two components are...
-
Write a program that compresses a source file into a target file using the Huffman coding method. First use ObjectOutputStream to output the Huffman codes into the target file, and then use...
-
Write a program that prompts the user to enter a file name, then displays the frequency table of the characters in the file and displays the Huffman code for each character.
-
What is the difference between business process reengineering and continuous improvement? Which one of these would qualify as a project?
-
Thomson Company's income statement for the year ended December 31, 20X4, reported net income of $360,000. The financial statements also disclosed the following information: Depreciation $60,000...
-
Based on past experience, Maas Corporation (a U.S.-based company) expects to purchase raw materials from a foreign supplier at a cost of 1,800,000 francs on March 15, 2024. To hedge this forecasted...
-
Suppose that laws are passed banning labor unions and that resulting lower labor costs are passed along to consumers in the form of lower prices. Assume that the U.S. economy was in long-run...
-
What's wrong with the following statement? "Because the digits 0, 1, 2,....9 are the normal results from lottery drawings, such randomly selected numbers have a normal distribution." Choose the...
-
Matching Question Drag and drop various responsibilities of employers that are related to workplace values against the corresponding values. Drag and drop application. Justice Justice drop zone...
-
Its hard for smokers to quit. Perhaps prescribing a drug to fight depression will work as well as the usual nicotine patch. Perhaps combining the patch and the drug will work better than either...
-
Show, if u(x, y) and v(x, y) are harmonic functions, that u + v must be a harmonic function but that uv need not be a harmonic function. Is e"e" a harmonic function?
-
Describe and analyze an efficient method for removing all duplicates from a collection A of n elements.
-
Give an example input that requires merge-sort and heap-sort to take O(nlogn) time to sort, but insertion-sort runs in O(n) time. What if you reverse this list?
-
Given a sequence S of n values, each equal to 0 or 1, describe an in-place method for sorting S.
-
On January 1, Yankee Company issued $100,000 par value, 4%, 5-year bonds (i.e., there were 100 of $1,000 par value bonds in the issue). Interest is payable semiannually each January 1 and July 1 with...
-
In another transaction your company is importing equipment from US and directly selling this to a party in Indonesia. Consignment will not touch Indian Customs Territory. This transaction will be...
-
What does it mean when a companies book EVA is negative but there market EVA is positive?
Study smarter with the SolutionInn App