javascript code for hash compression

Get perfect grades by consistently using www.assignmentgeeks.org. Place your order and get a quality paper today. Take advantage of our current 20% discount by using the coupon code GET20


Order a Similar Paper Order a Different Paper

Hi, I need JavaScript code and corresponding HTML code to do the following:

If you look at some compression techniques (such as LZW Compression https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Welch ) they make use of the concept of hashing techniques to compress files. We are going to do something similar. Consider the phrase

To be or not to be, that is the question.

Even though it does not make much sense to do this as the phrase is short. We are going to create bins for each word, and record the position of the instances of the words in the proper bins. So write a program that first has a series of bins

to
be
or
not

Because the word to occurs in positions 1 and 5, the bin for the word to will contain 1 and 5

to: 1, 5
be: 2, 6
or: 3
not: 4

Write an program that will take the phrase, create bins for each word, and then record the instance position of each word in the bin. It will then output each bin (word) and the locations of the word in the phrase. So if the input was;

I want what I want and I know what I want.

The output would be;

I: 1, 4, 7, 10
what: 3, 9
want: 2, 5, 11
and: 6
know: 8

I have included the base shell code to use (see attached word document). Use this code and expand to make sure it functions per instructions.

You will be able to use the String split function to separate the input into the initial array and I will only use spaces to separate words when testing your code. You can use an array, Lists, or Queues or combinations of these to hold the information. For example you could keep the bins in an array and each bin could be a list.

"Is this question part of your assignment? We can help"

ORDER NOW
Writerbay.net

Need help with an assignment? We work for the best interests of our clients. We maintain professionalism and offer brilliant writing services in most of the fields ranging from nursing, philosophy, psychology, biology, finance, accounting, criminal justice, mathematics, computer science, among others. We offer CONFIDENTIAL, ORIGINAL (Turnitin & SafeAssign checks), and PRIVATE services using the latest (within 5 years) peer-reviewed articles. Kindly click on ORDER NOW to receive an A++ paper from our masters- and doctorate-prepared writers. Thank you in advance!

Get a 15% discount on your order using the following coupon code SAVE15


Order a Similar Paper Order a Different Paper