All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class DataStructures.BinarySearchTreeWithRank

java.lang.Object
   |
   +----DataStructures.BinarySearchTree
           |
           +----DataStructures.BinarySearchTreeWithRank

public class BinarySearchTreeWithRank
extends DataStructures.BinarySearchTree
Implements a binary search tree with a findKth method. Note that all "matching" is based on the compares method.


Constructor Index

 o BinarySearchTreeWithRank()

Method Index

 o findKth(int)
Find the kth smallest item in the tree.
 o main(String[])

Constructors

 o BinarySearchTreeWithRank
 public BinarySearchTreeWithRank()

Methods

 o findKth
 public Supporting.Comparable findKth(int k) throws Exceptions.ItemNotFound
Find the kth smallest item in the tree.

Parameters:
k - the desired rank (1 is the smallest item).
Returns:
the kth smallest item in the tree.
Throws: ItemNotFound
if k is less than 1 or more than the size of the tree.
 o main
 public static void main(java.lang.String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index