Question

In: Computer Science

Programming: Use the generic Huffman_Tree<T> on Blackboard to encode the words in your favorite nursery rhyme.


Programming: Use the generic Huffman_Tree<T> on Blackboard to encode the words in your favorite nursery rhyme. 

Solutions

Expert Solution

Let us take the word 'assessment', First we need to write the frequency of each letter in the word:

Letter Freq.
a 1
s 4
e 2
m 1
n 1
t 1

To construct a tree, we merge the two letters with least frequency and repeat the process untill we get the single element, the tree generated is:

Huffman code for words are:

Letter Code
a 100
s 0
e 110
m 101
n 1110
t 1111

Encoded word: 100001100010111011101111


Related Solutions

. Input the Restaurant menu problem into your generic linear programming spreadsheet and confirm the solution...
. Input the Restaurant menu problem into your generic linear programming spreadsheet and confirm the solution given (or prove it wrong). How Do Restaurants Use Linear Programming for Menu Planning? Linear algebra helps restaurants earn a profit. Restaurants use linear programming for menu planning. It uses basic algebra to optimize meal production and thereby increase restaurant profits. Linear algebra reflects a direct relationship between an increase or decrease in food resources, and an increase or decrease in meal production. For...
Both the SSTS and Circular 230 have been posted on Blackboard for your use in answering...
Both the SSTS and Circular 230 have been posted on Blackboard for your use in answering the following questions. Answer the following questions using the SSTS’s or Circular 230.   For each question cite the Standard or page number and section number of Circular 230 for which your answer is based upon. (Member means tax preparer.) (Disregard the page number) ______ 21.    A member may omit answering a question on a tax return if reasonable grounds exist for omitting the answer...
Discuss any API / libraries of your favorite programming language (e.g. python, c#, java etc.) that...
Discuss any API / libraries of your favorite programming language (e.g. python, c#, java etc.) that you have used/reused in any of your previous projects and how it contributes to the overall project.
Implement the MSI cache coherence protocol in your favorite programming language (C, C++, Java, python, etc.)....
Implement the MSI cache coherence protocol in your favorite programming language (C, C++, Java, python, etc.). Wikipedia has a nice high level description of the protocol. Consider only one level of cache which is a write back cache. Moreover, assume that there are 4 processing cores working on a single shared memory. To simplify, assume that you are writing the code for only one block of cache and that block can hold 4 different memory locations.
a. In your own words, define the concept of "Recursion" in terms of C++ programming. b....
a. In your own words, define the concept of "Recursion" in terms of C++ programming. b. In your own words, define the concept of "infinite recursion". c. In your own words, define "mutual recursion" as it pertains to C++ programming.
Instructions Use your solution from Programming Assignment 5 (or use your instructor's solution) to create a...
Instructions Use your solution from Programming Assignment 5 (or use your instructor's solution) to create a modular Python application. Include a main function (and a top-level scope check),and at least one other non-trivial function (e.g., a function that deals the new card out of the deck). The main function should contain the loop which checks if the user wants to continue. Include a shebang, and ID header, descriptive comments, and use constants where appropriate. Sample Output (user input in red):...
Instructions Use your solution from Programming Assignment 5 (or use your instructor's solution) to create a...
Instructions Use your solution from Programming Assignment 5 (or use your instructor's solution) to create a modular Python application. Include a main function (and a top-level scope check),and at least one other non-trivial function (e.g., a function that deals the new card out of the deck). The main function should contain the loop which checks if the user wants to continue. Include a shebang, and ID header, descriptive comments, and use constants where appropriate. Sample Output (user input in red):...
Use the 7 steps in an advertising campaign for one of your favorite product. Clearly label...
Use the 7 steps in an advertising campaign for one of your favorite product. Clearly label each step, and provide details for each.
2a) Explain in your own words what Ansoff’s generic strategy model (shown below) is useful for....
2a) Explain in your own words what Ansoff’s generic strategy model (shown below) is useful for. [5 marks]
Drug Class Exemplar Generic (Brand) Mechanism of Action (in your own words) Common and Major Side...
Drug Class Exemplar Generic (Brand) Mechanism of Action (in your own words) Common and Major Side Effects Nursing Actions/ Considerations Desired Outcomes PME 4.0 GI: Drugs for Nausea Serotonin Antagonist Ondansetron (Zofran) Dopamine Antagonist/ Prokinetic agent Metoclopromide (Reglan) Anti-Emetic Prochlorperazine (Compazine, Compro) PME 4.0 Infection: Anti-fungals Polyene Antibiotics Nystatin (Mycostatin) Azoles Miconazole (Monistat) PME 4.0 Infection: Anti-virals Purine Analog Acyclovir (Zovirax) headache and nausea.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT