In this assignment, you will implement code tomodel a problem tree structure domain of your choice, whether it be an org chart, a restaurant menu (appetizers, main dishes, salads, desserts, etc),...

1 answer below »

In this assignment, you will implement code tomodel a problem tree structure domain of your choice, whether it be an org chart, a restaurant menu (appetizers, main dishes, salads, desserts, etc), group-types of animals, etc. Be creative.


Once you have your tree model, you will use a Java graph component to visualize your model!


Don't worry, most of the code to do all this will be given to you. You will just need to modify the existing code to fit your problem set. You must implement something with a theme, that is a domain of your choice. If you turn in something Root-Child-Grandchilde-GreatGrandchild, you will get very few points.


Let's get to it.



Step 1:



  1. Download theJGraphX2.zip

    download
    zip file and extract it into your IntelliJ IdeaProjects home directory. My IdeaProjects home directory is at c:\users\\IdeaProjects

  2. Open the project JGraphX2 in IntelliJ by navigating to that directory and using File/Open.

  3. There are two executables of interest in this project all built for you: SimpleTreeNode and JGraphX2. TrySimpleTreeNodefirst by pressing the Run menu. If the class does not appear in the Run menu, open the class in the editor, and press thesecondRun. You should see all the available executables to choose from. SelectSimpleTreeNode.
    This program will load a tree data structure and print out the data. You should see something like this:
    Root:Child1:Grandchild1
    Root:Child1:Grandchild2
    Root:Child2:Grandchild3
    Root:Child3:GrandChild4
    Root:Child4
    Root:Child5
    Root:Child6




As you can see, this tree has a root with 6 children. Child1 has 2 children. Child2 and Child3 have 1 child each. This is the textual representation of our tree.


4. Now you can visualize this tree using the JGraphx library by running the executable JGraphX2. You should see a graphical version of the sample tree like this:JGraphX2



Step 2:



  1. Now it's your turn. Decide what problem domain you are going to use foryourtree.

  2. Modify the SimpleTreeNode executable and get your tree working with your data to print a textual representation of your model, as we did above. Your tree should contain at least 15 nodes and 3-5 levels.

  3. Then modify JGraphX2 such that it models your data correctly. If you see something anomalous, for example, a line from root directly to say the third level, or an unconnected node, you have a coding error.

  4. Provide a paragraph narrative of your model and the relationships you are modeling and what it all means, in case it's not obvious. Please model something meaningful to you. And in your narrative tell us what have you learned?

  5. Include your narrative in your submission comments or as a separate document. Your narrative and your domain choice will be at least 20% of your grade.

Answered 13 days AfterMar 30, 2021

Answer To: In this assignment, you will implement code tomodel a problem tree structure domain of your choice,...

Rushendra answered on Apr 13 2021
137 Votes
Why Tree?
Unlike Array and Linked List, which are linear data structures, tree is hierarchical (or
non-linear) data structure.
If we organize keys in form of a tree (with some ordering e.g., BST), we can search for a given key in moderate time (quicker than Linked List and slower than arrays)
In...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here