Answered step by step
Verified Expert Solution
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:
obtainI y
insertI x
deleteItem
deleteI x
hasI y
membershipEqualsI x I y
searchI 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 InvalidStateException when the cursor is on the root already.
public void parent throws InvalidStateException
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 ContainerEmptyException if the tree is empty.
@throws InvalidStateException if the current node has no left child.
public void goLeftChild throws InvalidStateException, ContainerEmptyException
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 ContainerEmptyException if the tree is empty.
@throws InvalidStateException if the current item has no right child.
public void goRightChild throws InvalidStateException, ContainerEmptyException
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 ContainerEmptyException if the tree is empty.
@throws InvalidStateException if the current item has no sibling.
public void goSibling throws InvalidStateException, ContainerEmptyException
TODO Implement this method
Move the cursor to the root of the tree.
@precond The tree must not be empty.
@throws ContainerEmptyException if the tree is empty.
public void root throws ContainerEmptyException
TODO Implement this method
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