com.mhhe.clrs2e
Class FibHeap.Node

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

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

Inner class for a node within a Fibonaaci heap.


Field Summary
 FibHeap.Node child
          Some child of this node.
 int degree
          How many children this node has.
 FibHeap.Node left
          This node's left sibling.
 boolean mark
          true if this node is marked, false if not marked.
 com.mhhe.clrs2e.DynamicSetElement object
          The object stored in this node.
 FibHeap.Node p
          This node's parent, or null if this node is a root.
 FibHeap.Node right
          This node's right sibling.
 
Constructor Summary
FibHeap.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, along with its degree and mark.
 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 FibHeap.Node p
This node's parent, or null if this node is a root.


child

public FibHeap.Node child
Some child of this node.


right

public FibHeap.Node right
This node's right sibling.


left

public FibHeap.Node left
This node's left sibling.


degree

public int degree
How many children this node has.


mark

public boolean mark
true if this node is marked, false if not marked.

Constructor Detail

FibHeap.Node

public FibHeap.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, along with its degree and mark.

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.