class FibonacciHeap::Node
A single node in a Fibonacci Heap
.
Contains a key and optional value that can be any arbitrary object. The key will be used to sort nodes so that the key of a node is greater than or equal to the key of its parent.
Defaults to storing the key as the value.
Attributes
Return the list of child nodes for this node.
Return the degree of this node.
Return the key of the node.
Return the node previous to this one.
Return whether this node is marked or not.
Return the node next to this one.
Return the parent of this node or nil if there is none.
Return the node previous to this one.
Return the node next to this one.
Return the value of the node.
Public Class Methods
Return a new node with the given key and optional value.
The key and value can be any arbitrary object.
The node's next and previous pointers will default to itself.
Defaults the value to the key.
# File lib/fibonacci_heap/node.rb, line 43 def initialize(key, value = key) @key = key @value = value @next = self @prev = self end
Public Instance Methods
# File lib/fibonacci_heap/node.rb, line 50 def inspect %(#<#{self.class} key=#{key.inspect} value=#{value.inspect}>) end