Class: Containers::Heap::Node
- Inherits:
-
Object
- Object
- Containers::Heap::Node
- Defined in:
- lib/containers/heap.rb
Overview
Node class used internally
Instance Attribute Summary collapse
-
#child ⇒ Object
:nodoc:.
-
#degree ⇒ Object
:nodoc:.
-
#key ⇒ Object
:nodoc:.
-
#left ⇒ Object
:nodoc:.
-
#marked ⇒ Object
:nodoc:.
-
#parent ⇒ Object
:nodoc:.
-
#right ⇒ Object
:nodoc:.
-
#value ⇒ Object
:nodoc:.
Instance Method Summary collapse
-
#initialize(key, value) ⇒ Node
constructor
A new instance of Node.
- #marked? ⇒ Boolean
Constructor Details
#initialize(key, value) ⇒ Node
Returns a new instance of Node.
300 301 302 303 304 305 306 307 |
# File 'lib/containers/heap.rb', line 300 def initialize(key, value) @key = key @value = value @degree = 0 @marked = false @right = self @left = self end |
Instance Attribute Details
#child ⇒ Object
:nodoc:
298 299 300 |
# File 'lib/containers/heap.rb', line 298 def child @child end |
#degree ⇒ Object
:nodoc:
298 299 300 |
# File 'lib/containers/heap.rb', line 298 def degree @degree end |
#key ⇒ Object
:nodoc:
298 299 300 |
# File 'lib/containers/heap.rb', line 298 def key @key end |
#left ⇒ Object
:nodoc:
298 299 300 |
# File 'lib/containers/heap.rb', line 298 def left @left end |
#marked ⇒ Object
:nodoc:
298 299 300 |
# File 'lib/containers/heap.rb', line 298 def marked @marked end |
#parent ⇒ Object
:nodoc:
298 299 300 |
# File 'lib/containers/heap.rb', line 298 def parent @parent end |
#right ⇒ Object
:nodoc:
298 299 300 |
# File 'lib/containers/heap.rb', line 298 def right @right end |
#value ⇒ Object
:nodoc:
298 299 300 |
# File 'lib/containers/heap.rb', line 298 def value @value end |
Instance Method Details
#marked? ⇒ Boolean
309 310 311 |
# File 'lib/containers/heap.rb', line 309 def marked? @marked == true end |