Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

Purpose: To implement an ADT to support efficient execution …

Purpose: To implement an ADT to support efficient execution of a HuffmanTree encoder Degree of Difficulty: Easy to Moderate Phoenix right, ace attorney, loves being lazy – erm, efficient. Phoenix is also short on money. He has heard of text compression, and thinks it might be a good idea to compress all his text files to save on valuable disk space (disk space is expensive for him!). Larry Butz, his useless IT friend, wrote most of the code for text compression using Huffman trees, but did not finish the job (surprising no one). On the Assignment 10 Moodle page, you'll find a program named Encoder.py. The program follows a simple design, and is well-documented. All the pieces should be familiar to you, as they are similar to discussion in class The Encoder.py program imports two supporting ADIS . HuffmanTree.py Defines the Huf fmanTree class . Huf fmanHeap.py Defines the Huf fmanHeap class The HuffmanTree class was discussed in lecture, and its definition should be familiar. There is one change that you should note: the function build_codec ) that builds the codec from a HuffmanTree object is now a method in the HuffmanTree class. The ADT HuffmanHeap, was also discussed in lecture, though the code was not given. A heap is a kind of queue that guarantees that the dequeue operation always removes and returns the smallest value in the queue (this is not the FIFO protoco). The HuffmanHeap stores Huf fmanTree objects, and has the following methods: .init__(self, leaf s): Creates a new HuffmanHeap object. enqueue (self, tree) the given HuffmanTree to the heap, dequeue (self): Removes and returns the smallest HuffmanTree in the heap. ..len__(self): Returns the number of HuffmanTrees in the heap. Defining this method allows pro- l enen BoS POP grammers to call len on Huff manHe ap objects.

The post Purpose: To implement an ADT to support efficient execution … appeared first on Academicheroes.com.

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"