com.mhhe.clrs2e
Class BinomialHeap.Node

java.lang.Object
  |
  +--com.mhhe.clrs2e.BinomialHeap.Node
Enclosing class:
BinomialHeap

private static class BinomialHeap.Node
extends java.lang.Object

Inner class for a node within a binomial heap.


Field Summary
 BinomialHeap.Node child
          This node's leftmost child, or null if this node has no children.
 int degree
          The number of children that this node has.
 BinomialHeap.Handle handle
          A handle to this node.
 com.mhhe.clrs2e.DynamicSetElement object
          The object stored in this node.
 BinomialHeap.Node p
          This node's parent, or null if this node is a root.
 BinomialHeap.Node sibling
          This node's right sibling, or null if this node has no right sibling.
 
Constructor Summary
BinomialHeap.Node(com.mhhe.clrs2e.DynamicSetElement e)
          Creates a new node.
 
Method Summary
 java.lang.String toString()
          Returns the String representation of this node's object.
 java.lang.String walk(int depth)
          Returns the String representation of the subtree rooted at this node, based on the objects in the nodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

object

public com.mhhe.clrs2e.DynamicSetElement object
The object stored in this node.


p

public BinomialHeap.Node p
This node's parent, or null if this node is a root.


child

public BinomialHeap.Node child
This node's leftmost child, or null if this node has no children.


sibling

public BinomialHeap.Node sibling
This node's right sibling, or null if this node has no right sibling.


degree

public int degree
The number of children that this node has.


handle

public BinomialHeap.Handle handle
A handle to this node.

Constructor Detail

BinomialHeap.Node

public BinomialHeap.Node(com.mhhe.clrs2e.DynamicSetElement e)
Creates a new node.

Parameters:
e - The dynamic set element to store in the node.
Method Detail

toString

public java.lang.String toString()
Returns the String representation of this node's object.

Overrides:
toString in class java.lang.Object

walk

public java.lang.String walk(int depth)
Returns the String representation of the subtree rooted at this node, based on the objects in the nodes. It represents the depth of each node by two spaces per depth preceding the String representation of the node.

Parameters:
depth - Depth of this node.