![]() ![]() You should see an increasing sequence of values (from low frequency to high). ![]() You can write some testing code that repeatedly calls remove on your PriorityQueue, printing the frequency of each node as it is removed from the PriorityQueue. Try looking at the Lectures page for more information on how to deal with priority queues. Why?”Ī: A PriorityQueue’s toString behavior (as well as the result of using an iterator/foreach, or viewing the PQ in jGRASP) does not show the elements in their sorted order, so it might be confusing to use these methods of debugging. Q: “The contents of my priority queue don’t seem to be in sorted order. Avoid such characters by making sure to right-click the input text files when you save them, rather than doing select-all, copy-paste into your editor. If you see any values that are out of order, then you have a bug.īe aware of the problem with r characters that occur as new lines in some text-editors. Remember that nodes are supposed to be added to the PriorityQueue in increasing character order. Take a look at the writeup for how to set up jGRASP in order to Look at the HuffmanTree.Īdd a println to the constructor of your node class that will report the character value for every leaf node that it constructs. See if your tree is adding in nodes in the correct manner (pull off two, make a new node and attach them to it, re-insert into the priority queue). How can I tell what’s going on?”Ī: Try adding debugging code or use the structure viewer in jGRASP to view your Huffman Tree. Q: “My tree doesn’t get created correctly. Be sure to also look over your section handouts for help on how to attach each node of the Huffman Tree to the new parent node. They explain how the priority queue works with the alogrithm we’ve given you. Q: I don’t understand what is going on in this assignment.Ī: Take a look at the pictures in the assignment writeup and lecture slides. Your jGRASP debugger won’t look exactly like this, but the characters, frequencies, and positions of nodes in the tree should match. You can fix this by selecting the wrench icon (“Configure the structure to view mapping”). This viewer will show you the structure of the tree, but may not show you the contents of the nodes. You do so by dragging one of your fields from the debug window outside the window and jGRASP will launch a viewer. Remember that in jGRASP you can use a structure viewer to see what your tree looks like. ![]() Instead, you should right click on the links below and click “Save as” or “Save Link as” (or equivalent). Different operating systems and different browsers can affect copy/paste behavior. It does not work to copy/paste the contents of these files. On the left column is the uncompressed input files, in the middle are the compressed output files, and the right shows the debug output (the last prompt of the client program asks if you want to view debug output). Output Comparison Tool can help you identify differences with your program’s output and the expected output.īelow we include a table of files that you will find helpful for the assignment.This will allow you to work offline, and access the great debugger provided by jGrasp! You can download the code from Ed and when you want to submit, upload it again and then pressing Mark to submit. You are welcome to use Ed as your environment to work on the homework, but we recommend setting up a local environment following our Desktop Software instructions. Please make sure you are familiar with the resubmission and late work policy on the syllabus Developing at Home ¶ You can view your past submissions using the “Submissions” button. To submit on EdStem, you should use the Mark button to submit your code. You may submit any part of the assignment as many times as you want before the initial submission. Specification Intro Video Submit Code and Reflection Initial Submission by Friday 12/10 at 11:59 pm. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |