This programming option can be implemented in C, C++ or Java. We will try to give a description of the requirements in a programming language independent way.
It is an assignment that requires the use of heap-related structures and operations. Such operations must adhere to the semantics of the corresponding operations dened in the textbook (CLRS); of course array in the textbook start from 1 but in C/C++/Java start from 0. Some adjustments are thus necessary. You are not allowed to use Java or C or C++ classes that implement a Heap or a Priority Queue. YOU MUST IMPLEMENT YOUR OWN.
If the naming conventions below are not facilitated or accommodated by the programming language you plan to use, you are free to modify the names of the various functions. If this happens, however, you MUST provide sucient information in the le indicated in Handout 2.
Human coding. Says all. Input argument file in the command-line is an arbitrary le-name. You need to provide a correct Human coding implementation that implements the algorithm described in class and also available in the notes or the textbook. Such an algorithm must work not just in text les but also binary les (pdf, images, video, etc). For small les do not get bothered if savings due to compression are small or negligible. In general for les less than 10MiB, an implementation should take more than a few seconds, may be 15 seconds forgivingly
Note that henc for Human encoding, or hdec for Human decoding should adhere to the Handout 2 requirements (i.e. they are more likely to be henc 4567 or hdec 4567.
// converts file into file.huf myfile.pdf into myfile.pdf.huf and so on
% java henc file
% ./henc file
% java henc myfile.pdf
% ./henc myfile.pdf
// converts file.huf into file , myfile.pdf.huf into myfile.pdf and so on
% java hdec file.huf
% ./hdec myfile.pdf.huf
// Operation henc is NON destructive! myfile.pdf would coexist with myfile.pdf.huf
// Operation hdec is destructive! file created from file.huf
// would ovewrite a previous file
Test Files Example
% ./henc h1435s16.pdf
% ./henc nytimes_google3.pdf
Note 1: Reminder. Document your bugs
Note 2: Deliverables. Include all implemented functions or classes in an archive per Handout 2 guidelines. Command-line execution: do not prompt to read a le-name. Everything command-line based.