edu.princeton.cs.algs4.growingtree.demos
Class RandomizedBSTInsertion<P extends NodeProperties>

java.lang.Object
  extended by 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>


Constructor Summary
RandomizedBSTInsertion()
           
 
Method Summary
 void doInsert(IInsertingNode<P> root, INode<P> newNode)
           
 void put(IInsertingNode<P> x, INode<P> newNode)
           
 void putRoot(IInsertingNode<P> x, INode<P> newNode)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomizedBSTInsertion

public RandomizedBSTInsertion()
Method Detail

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 tree
newNode - Node to be inserted into the tree. Null when inserting into an empty tree.