|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
P
- public interface IInsertingNode<P extends 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.
Method Summary | |
---|---|
IInsertingNode<P> |
getLeft()
|
IInsertingNode<P> |
getParent()
|
IInsertingNode<P> |
getRight()
|
IAlgorithmNode<P> |
insertLeft(INode<P> newNode)
This should only be called once per call to IInsertOperator.doInsert |
IAlgorithmNode<P> |
insertRight(INode<P> newNode)
This should only be called once per call to IInsertOperator.doInsert |
IInsertingNode<P> |
rotateLeft()
Rotates the left child up. |
IInsertingNode<P> |
rotateRight()
Rotates the right child up. |
Methods inherited from interface edu.princeton.cs.algs4.growingtree.interfaces.IAlgorithmNode |
---|
freeze, freeze, getPredecessor, getRoot, getSuccessor |
Methods inherited from interface edu.princeton.cs.algs4.growingtree.interfaces.INode |
---|
getLogger, getNodeProperties |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Method Detail |
---|
IAlgorithmNode<P> insertLeft(INode<P> newNode)
IInsertOperator.doInsert
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
IAlgorithmNode<P> insertRight(INode<P> newNode)
IInsertOperator.doInsert
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
IInsertingNode<P> rotateLeft()
IAlgorithmNode
rotateLeft
in interface IAlgorithmNode<P extends NodeProperties>
IInsertingNode<P> rotateRight()
IAlgorithmNode
rotateRight
in interface IAlgorithmNode<P extends NodeProperties>
IInsertingNode<P> getLeft()
getLeft
in interface IAlgorithmNode<P extends NodeProperties>
IInsertingNode<P> getRight()
getRight
in interface IAlgorithmNode<P extends NodeProperties>
IInsertingNode<P> getParent()
getParent
in interface IAlgorithmNode<P extends NodeProperties>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |