package edu.princeton.cs.algs4.growingtree.interfaces; import edu.princeton.cs.algs4.growingtree.framework.NodeProperties; /** * This interface declares the functions for traversing and manipulating trees * that are accessible to all operators. * * @author Josh Israel * * @param
The NodeProperties
class (or subclass) that these
* nodes are parameterized by.
* @see NodeProperties
*/
public interface IAlgorithmNode
extends INode
{ public IAlgorithmNode
getParent(); public IAlgorithmNode
getRoot(); public IAlgorithmNode
getLeft(); public IAlgorithmNode
getRight(); public IAlgorithmNode
getSuccessor(); public IAlgorithmNode
getPredecessor(); /** * Freezes the animation briefly and displays the current state of the tree. * This allows states between events like rotations to be displayed. */ public void freeze(double delay); public void freeze(); /** * Rotates the left child up. * @return The new parent of the node (the former left child). */ public IAlgorithmNode
rotateLeft(); /** * Rotates the right child up. * @return The new parent of the node (the former right child). */ public IAlgorithmNode
rotateRight(); }