Questions
write a program in Java that can take a given text file and then compress it...

write a program in Java that can take a given text file and then compress it with Huffman coding due 20 october 2020

Huffman coding can be used to “zip” a text file to save space. You are required to write a program in Java that can take a given text file and then compress it with Huffman coding. Your program should be able to decompress the zipped files as well [4 marks]. In addition, show percentage gain in data compression i.e., how much space is saved [2 marks].

Compare the effectiveness of your Huffman code with 7-zip and WinZip softwares. You will get a bonus mark if you enhance the existing Huffman code somehow to have a better file compressor. It can also be published as a research article.

Correct Implementation: read about FileOutputStream, FileInputStream, FileReader etc to read/write to a binary file. You may use Integer.parseInt(huffmanCodeAsString,2) to store encoded Huffman code into a binary file. Huffman encoding should convert a text file to a binary file then decoding should convert the binary file back to a text file.

Please provide all java code. Be clear as possible when you paste the code so that it works in my pc  

Use netbeans IDE.

In: Computer Science

Assume that 60% of people are left-handed. If we select 5 people at random, find the...

Assume that 60% of people are left-handed. If we select 5 people at random, find the probability of each outcome described below, rounded to four decimal places:

a. There are some lefties (≥ 1) among the 5 people.

b. There are exactly 3 lefties in the group.

c. There are at least 4 lefties in the group.

d. There are no more than 2 lefties in the group.

e. How many lefties do you expect?

f. With what standard deviation?

In: Math

Describe the purpose of a corporate governance and describe its relationship to corporate social responsibility. When...

  • Describe the purpose of a corporate governance and describe its relationship to corporate social responsibility.
  • When it comes to creating value for shareholders, discuss some competing interests among the key players in the corporate governance structure.
  • Support your opinions with evidence from the readings or other reputable materials.

In: Operations Management

5. In a two-slit experiment, the slit separation is 3.00x 10^-5 m. The interference pattern is...

5. In a two-slit experiment, the slit separation is 3.00x 10^-5 m. The interference pattern is created on a screen that is 2.00 m away from the slits. If the 7th bright fringe on the screen is 10.0 cm away, from the central fringe, what is the wavelength of light?

6. A single slit, which is 0.0500 mm wide, is illuminated by light of 550 nm wavelength. What is the angular separation between the first two minima on either side of the central maximum?

In: Physics

Research Walmart and give an example of how the company is following a Cost Leadership strategy...

Research Walmart and give an example of how the company is following a Cost Leadership strategy Describe what Walmart is doing to implement this form of competitive advantage. Be specific in explain which benefits the company has eliminated to reduce costs.

In: Economics

Q. Discussion on the external and internal factors that are driving the need for change in...

Q. Discussion on the external and internal factors that are driving the need for change in the organization.

In: Operations Management

Identify and describe a company with an ineffective organizational design. How would you organize for success...

Identify and describe a company with an ineffective organizational design. How would you organize for success and why?

In: Operations Management

Suppose growth in government spending in an economy permanently rises. Using the AD-AS model, explain the...

Suppose growth in government spending in an economy permanently rises. Using the
AD-AS model, explain the effects of the permanent increase in government
spending growth on the inflation rate and the real growth rate in both the short run and the long
run.

In: Economics

Crime Control Model Define the assigned theory of punishment. Identify and describe an example of a...

Crime Control Model

  1. Define the assigned theory of punishment. Identify and describe an example of a movie, television show or novel that depicts this theory of punishment.
  2. Describe the prison system that was established under the assigned theory of punishment. What was the philosophical basis for this style of punishment (i.e., religion, political changes, science, etc.)? Identify the goals for the prison system. What types of activities were inmates assigned under this prison system? Did prisons gain revenue because of inmate productivity? How was this accomplished?
  3. Compare the either prison system reviewed to the Auburn (New York) or Pennsylvania Prison System. Describe the similarities and differences between the two systems.
  4. Assess the strengths and weaknesses of your assigned theory of punishment. Provide two weaknesses and two strengths for the theory of punishment and its prison system.

In: Operations Management

What is outsourcing governance?

What is outsourcing governance?

In: Computer Science

Develop a simple MIS (Management Information System) that consists of a simple database (a text file)....

Develop a simple MIS (Management Information System) that consists of a simple database (a text file). The system manages to dynamically input record/data into the database. The data from the database can be sorted, searched and updated. User also should be able to add new records/data, remove any data and etc.
Here are some ideas of MIS that can be developed:
1. Hotel reservation system.
2. Students management system.
3. Payroll management system.
4. Bus/Railway/Plane ticketing system.
5. Clinic record management system.

In: Mechanical Engineering

If one estimator generated cost estimates on the same day for two projects that were the...

  1. If one estimator generated cost estimates on the same day for two projects that were the same (like a super-sized Wal-Mart) type of facility, what are the most important reasons why the estimates could be different (4)?

In: Operations Management

About 3 million years ago, the Isthmus of Panama (a narrow strip of land connecting North...

About 3 million years ago, the Isthmus of Panama (a narrow strip of land connecting North and South America) formed, dividing marine organisms into Pacific and Caribbean populations. Researchers have examined species of snapping shrimp on both sides of the isthmus. Based on the morphological species concept, there appeared to be seven pairs of closely related species, with one species of each pair in the Pacific and the other in the Caribbean. The different species pairs live at different depths in the ocean. Using mitochondrial DNA sequences, the researchers estimated phylogenies and found that each of these species pairs (sister species), separated by the isthmus, were indeed each other's closest relatives. The researchers investigated mating in the lab and found that many species pairs were not very interested in courting with each other, and, any that did mate, almost never produced fertile offspring.

1. These species are distinctive species under all three species concepts.

a. Likely

b. Not Likely

2. Sympatric speciation caused the difference between the seven species on the Pacific side.

a. Likely

b. Not Likely

3. Sympatric speciation caused the differences between the sets of sister species on either side of the Isthmus.

a. Likely

b. Not likely

4. If sea levels rises enough to cover the isthmus, the sister species on either side of the isthmus will likely undergo fusion.

a. Likely

b. Not likely

5. Habitat isolation is the only reproductive isolating barrier preventing the formation of hybrid from the different sister species.

a. Likely

b. Not likely

6. If sea levels rise enough to cover the isthmus, the frequency of hybrid offspring would decrease.

a. Likely

b. Not likely

7. What other type of reproductive isolating barrier is creating the reinforcement of differences between the sister (closely related) shrimp species pairs?

a. Behavioral isolation

b. Gametic isolation

c. Temporal isolation

d. Reduced hybrid fertility

e. Both A and D

In: Biology

Your company is looking at updating its production process by adding a new piece of equipment....

Your company is looking at updating its production process by adding a new piece of equipment. The company uses a 9% cost of capital in its capital budgeting decisions. The new equipment will cost $350,000 and the company expects the following annual cash flows for 5 years as a result of the purchase (note that year 1 is negative): Year 1 (10,000) Year 2 45,000 Year 3 127,000 Year 4 168,000 Year 5 145,000 A) Calculate the Net Present Value (NPV) of the acquisition project. B) Calculate the Internal Rate of Return (IRR) of the acquisition project. C) Should the company purchase the new equipment? Explain.

In: Finance

Trace this code: 1) #include<iostream> using namespace std;    class Test {     int value; public:     Test(int...

Trace this code:

1)

#include<iostream>

using namespace std;

  

class Test {

    int value;

public:

    Test(int v);

};

  

Test::Test(int v) {

    value = v;

}

  

int main() {

    Test t[100];

    return 0;

}

===================================================================

2)

#include <iostream>

using namespace std;

int main()

{

                int i, j;

                for (i = 1; i <= 3; i++)

                {

                                //print * equal to row number

                                for (j = 1; j <= i; j++)

                                {

                                                cout << "* ";

                                }

                                cout << "\n";

                }

                system("pause");

                return 0;

In: Computer Science