Question
Be sure to submit all questions and the two parts of this assignment by the due date. You may zip all of the files together
Be sure to submit all questions and the two parts of this assignment by the due date. You may zip all of the files together to submit on blackboard.
General Questions Be sure to explain in detail in order to receive full credit (6pts)
Why do recursive algorithms work so well with tree structures?
Which binary tree implementation is the most efficient?
Why cant a level order traversal be implemented recursively?
Code Activities:
Part 1 - Tree Height (8 pts)
Add a method to the LinkedBinaryTree class that returns the height of a tree. Like many tree methods, this will require a fairly simple method in LinkedBinaryTree and another method in BTNode that does most of the work. First, check to see if the root is null. If it is, then the tree is obviously empty and return 0. If it is not null, return root.height().
Part 2 - Decision Tree (16 pts)
Create a decision tree for a topic of your choice. Examples: How to choose a college major? How to select a car? How to determine what to eat for dinner? You must have at least 14 questions that you could potentially ask the user. You will need to add a few missing methods to get your program to work correctly.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started