Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement these methods for an Arrayed Binary Tree When the class already has these methods: obtain ( I y ) insert ( I x )

Implement these methods for an Arrayed Binary Tree
When the class already has these methods:
obtain(I y)
insert(I x)
deleteItem()
delete(I x)
has(I y)
membershipEquals(I x, I y)
search(I x)
before()
after()
goForth()
goFirst()
restartResearches()
resumeResearches()
currentPosition()
goPosition()
@Override
public void goBefore(){
// TODO - Implement this method
}
@Override
public void goAfter(){
// TODO - Implement this method
}
/**
* Move the cursor to the parent of the current node.
* @precond Current node is not the root.
* @throws InvalidState280Exception when the cursor is on the root already.
*/
public void parent() throws InvalidState280Exception {
// TODO - Implement this method
}
/**
* Move the cursor to the left child of the current node.
*
* @precond The tree must not be empty and the current node must have a left child.
* @throws ContainerEmpty280Exception if the tree is empty.
* @throws InvalidState280Exception if the current node has no left child.
*/
public void goLeftChild() throws InvalidState280Exception, ContainerEmpty280Exception {
// TODO - Implement this method
}
/**
* Move the cursor to the right child of the current node.
*
* @precond The tree must not be empty and the current node must have a right child.
* @throws ContainerEmpty280Exception if the tree is empty.
* @throws InvalidState280Exception if the current item has no right child.
*/
public void goRightChild() throws InvalidState280Exception, ContainerEmpty280Exception {
// TODO - Implement this method
}
/**
* Move the cursor to the sibling of the current node.
*
* @precond The current node must have a sibling. The tree must not be empty.
* @throws ContainerEmpty280Exception if the tree is empty.
* @throws InvalidState280Exception if the current item has no sibling.
*/
public void goSibling() throws InvalidState280Exception, ContainerEmpty280Exception {
// TODO - Implement this method
}
/**
* Move the cursor to the root of the tree.
*
* @precond The tree must not be empty.
* @throws ContainerEmpty280Exception if the tree is empty.
*/
public void root() throws ContainerEmpty280Exception {
// TODO - Implement this method
}

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 Fundamentals Study Guide

Authors: Dr. Sergio Pisano

1st Edition

B09K1WW84J, 979-8985115307

More Books

Students also viewed these Databases questions