edu.princeton.cs.algs4.growingtree.demos
Class RandomizedBSTInsertion<P extends NodeProperties>
java.lang.Object
edu.princeton.cs.algs4.growingtree.demos.RandomizedBSTInsertion<P>
- All Implemented Interfaces:
- IInsertOperator<P>
public class RandomizedBSTInsertion<P extends NodeProperties>
- extends java.lang.Object
- implements IInsertOperator<P>
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RandomizedBSTInsertion
public RandomizedBSTInsertion()
putRoot
public void putRoot(IInsertingNode<P> x,
INode<P> newNode)
put
public void put(IInsertingNode<P> x,
INode<P> newNode)
doInsert
public void doInsert(IInsertingNode<P> root,
INode<P> newNode)
- Specified by:
doInsert
in interface IInsertOperator<P extends NodeProperties>
- Parameters:
root
- Root of the treenewNode
- Node to be inserted into the tree. Null when
inserting into an empty tree.