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

java.lang.Object
  extended by edu.princeton.cs.algs4.growingtree.demos.BSTSearch<P>
All Implemented Interfaces:
ISearchOperator<P>
Direct Known Subclasses:
SplayOperators.SplaySearch

public class BSTSearch<P extends NodeProperties>
extends java.lang.Object
implements ISearchOperator<P>


Constructor Summary
BSTSearch()
           
 
Method Summary
 INode<P> doSearch(ISearchingNode<P> root, java.lang.Comparable<INode<P>> keyCompare)
           
 IAlgorithmNode<P> search(ISearchingNode<P> root, java.lang.Comparable<INode<P>> keyCompare)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BSTSearch

public BSTSearch()
Method Detail

search

public IAlgorithmNode<P> search(ISearchingNode<P> root,
                                java.lang.Comparable<INode<P>> keyCompare)

doSearch

public INode<P> doSearch(ISearchingNode<P> root,
                         java.lang.Comparable<INode<P>> keyCompare)
Specified by:
doSearch in interface ISearchOperator<P extends NodeProperties>
Parameters:
root - The root of the tree
keyCompare - Comparable representing the key being sought
Returns:
The node being sought