Write a program to implement Huffman coding and decoding. It should do the following:
- Accept a text message, possibly of more than one line.
- Create a Huffman tree for this message.
- Create a code table.
- Encode the message into binary.
- Decode the message from binary back to text.
If the message is short, the program should be able to display the Huffman tree after creating it. You can use String variables to store binary numbers as arrangements of the characters 1 and 0. Don’t worry about doing actual bit manipulation unless you really want to.
- Write a program that translates expressions from infix to postfix
- Bubble
- Selection
- Insertion
- Shell's sort
- Mergesort
- Quicksort
- Heapsort
- Radixsort
- Bucketsort
-
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.
-
Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.
-
The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ?