Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi can you help me with this Java assignment to solve the Huffman Coding Tree and AVL tree? It's URGENT! Thanks! :) Do it in

Hi can you help me with this Java assignment to solve the Huffman Coding Tree and AVL tree? It's URGENT! Thanks! :)

Do it in Java. Do not use javas search or sort methods. Do not use any java pre-built data structures besides arrays! Do not use Javas Collections or Subclasses!

This assignment has a significant design component. You will use UML class diagrams and text to explain your decisions inside the diagrams, as well as any

additional decisions. Do the design first! Dont use packages! Dont deviate from the file names indicated! Huffman.java and ATree.java That includes renaming the file, but leaving the class inside it the same. You may include other files, and those files may be in packages.

Due: Friday, June 16th Grade: 30%

Question 1. Designing a flexible tree structure

(a) Design a tree structure that you will implement and subclass to solve both the Huffman Coding Problem and the AVL Tree problem.

(b) Include a class diagram showing all the supporting classes of this tree structure on UML. (A drawing/picture is fine too btw)

(c) Explain your decisions.

(d) Include a class diagram showing how you Huffman Coding implementation will extend your general tree structure

(f) Include a class diagram showing how either AVL Tree implementation will extend your general tree structure.

Question 2: Implement a Huffman Coding Tree based off of the design in question 1.

(a) Your tree should build itself using https://users.encs.concordia.ca/~sthiel/comp352/Jabberwock.txt

(b) Include the characters for spacing as well as all punctuation, but not line breaks.

(c) You should not make encoding for characters not found in the source text, and I will not use any such characters while testing your code.

(d) When Two characters with the same weight are merged into one subtree, your program should choose for the left child, the element that came first in the source material.

(e) When two subtrees with the same weight are merged into one subtree, your program should choose for the left child, the element that came first in the priority queue or ordered list you were using to build the tree.

(f) Using the command line, your program should be called as java Huffman

(g) will be the name of the local file to be loaded to built your Huffman Tree

(h) Upon starting, a frequency table will be built. Your program should listen to stdin (you may use Scanner) and encode any line entered (terminated by a line break) and output the encoded version using 1s and 0s (vs. padded ASCII).

(i) Your program should multiple lines to be entered, encoding each one as it is entered.

Question 3. Implement either an AVL Tree or a Splay tree based off of the design in question 1.

(a) Using the command-line, your program should be called as java ATree

(b) will be the name of the local file to be loaded that contains operations

(c) Your program should output the following statistics after each command:

The total number of comparisons.

The total number of times a nodes parent changes (including new nodes getting their first parent, and removed nodes "losing their parent").

The total number of find operations

The total number of add operations

the total number of remove operations.

(d) The operations in the source file will be one-per-line and will consist of the letters a,r or f, representing add, remove or find respectively, followed by 3 digits, the value for the node.

(e) The sample source file that your should run your code against is https://users.encs.concordia.ca/~sthiel/comp352/Operations.txt

(f) note: The tree starts out empty and is filled by the operations.txt (or similar file). Your program should deal properly with trying to find or delete nods that arent in the tree.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions

Question

7. Discuss the implications of a skill-based pay plan for training.

Answered: 1 week ago

Question

4. Make recommendations on steps to take to melt the glass ceiling.

Answered: 1 week ago