Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I ' m having a little trouble on my computer science homework. Our professor provided us with the outline of some code that we have

I'm having a little trouble on my computer science homework. Our professor provided us with the outline of some code that we have to complete and I'm having trouble figuring out how to do some of them. Here is a segment I was working that was giving me trouble:
private Node findMin(Node start)
{
/*
* based on the implementation shows on the slides, find and return the node contains the minimum elements
**/
}
private Integer findMax(Node start)
{
/*
** based on the implementation shows on the slides, find and return the maximum element
*/
}
public boolean insert(Integer newElement, Node start){
/*
* based on the insertion implementation shows on the slides, insert a newElement into a tree or subtree rooted at start
*/
}
public Node search(Node start, int target){
/*
* based on the implementation shows on the slides, find and return the node contains the target elements on a tree or subtree rooted at start
*/
}
public void remove(int target, Node start)
{
/*
* based on the implementation shows on the slides, find and return the maximum elements a target element from a tree or subtree rooted at start
*/
}
public ArrayList inOrder(Node start, ArrayList list){
/*
* based on the implementation demonstrated in class, return the inorder traversal elements sequence as an Arraylist
*/
}
public void cutBranch(Node start){
/*
* remove the subtree rooted at node start, all nodes in this subtree will be removed
*/
//recursion: cutBranch my leftsubtree, cutBranch my rightsubtree, remove myself
}
public boolean isIdentical(Node xRoot, Node yRoot){
/*
* check if tree rooted at xRoot and yRoot respectively are identical or not, return true for yes and false for no
*/
//if both roots are null (two empty trees), return true --base case
//if both root are not null, and values stored are equal, return isIdentical(both left subtree) && isIdentical(both right subtree)--recursive.
//all other case, return false
}

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

Visual Basic Net Database Programming

Authors: Rod Stephens

1st Edition

0789726815, 978-0789726810

More Books

Students also viewed these Databases questions