package edu.princeton.cs.algs4.growingtree.interfaces;
import edu.princeton.cs.algs4.growingtree.framework.NodeProperties;
/**
* This interface is for use by an IInsertOperator
to traverse and manipulate
* the tree. Some functions from IAlgorithmNode
are redeclared here with
* return type IInsertingNode
so as to avoid the need to cast in client code.
*
* @author Josh Israel
*
* @param
*/ public interface IInsertingNode
extends IAlgorithmNode
{
/**
* This should only be called once per call to IInsertOperator.doInsert
* @param newNode Node to be inserted as the left child of this one. It should
* not be any node other than the newNode argument to IInsertOperator.doInsert
* @return The node just inserted into the tree
*/
public IAlgorithmNode
insertLeft(INode
newNode);
/**
* This should only be called once per call to IInsertOperator.doInsert
* @param newNode Node to be inserted as the left child of this one. It should
* not be any node other than the newNode argument to IInsertOperator.doInsert
* @return The node just inserted into the tree
*/
public IAlgorithmNode
insertRight(INode
newNode); public IInsertingNode
rotateLeft(); public IInsertingNode
rotateRight(); public IInsertingNode
getLeft(); public IInsertingNode
getRight(); public IInsertingNode
getParent(); }