com.mhhe.clrs2e
Class OrderStatisticTree.Node

java.lang.Object
  |
  +--com.mhhe.clrs2e.BinarySearchTree.Node
        |
        +--com.mhhe.clrs2e.RedBlackTree.Node
              |
              +--com.mhhe.clrs2e.OrderStatisticTree.Node
All Implemented Interfaces:
java.lang.Comparable
Enclosing class:
OrderStatisticTree

protected class OrderStatisticTree.Node
extends RedBlackTree.Node

Inner class for an order-statistic tree node, extending a red-black tree node with an additional size field.


Field Summary
protected  int size
          Number of nodes in the subtree rooted at this node.
 
Fields inherited from class com.mhhe.clrs2e.RedBlackTree.Node
color
 
Fields inherited from class com.mhhe.clrs2e.BinarySearchTree.Node
data, left, parent, right
 
Constructor Summary
OrderStatisticTree.Node(java.lang.Comparable data)
          Initializes a new node in an order-statistic tree.
 
Method Summary
 java.lang.String toString()
          Returns a string representation of this node's data and size.
 
Methods inherited from class com.mhhe.clrs2e.BinarySearchTree.Node
compareTo, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

size

protected int size
Number of nodes in the subtree rooted at this node.

Constructor Detail

OrderStatisticTree.Node

public OrderStatisticTree.Node(java.lang.Comparable data)
Initializes a new node in an order-statistic tree.

Parameters:
data - Data to save in the node.
Method Detail

toString

public java.lang.String toString()
Returns a string representation of this node's data and size.

Overrides:
toString in class RedBlackTree.Node