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.
308 309 310 311 312 313 314 315 |
# File 'lib/containers/heap.rb', line 308 def initialize(key, value) @key = key @value = value @degree = 0 @marked = false @right = self @left = self end |
Instance Attribute Details
#child ⇒ Object
:nodoc:
306 307 308 |
# File 'lib/containers/heap.rb', line 306 def child @child end |
#degree ⇒ Object
:nodoc:
306 307 308 |
# File 'lib/containers/heap.rb', line 306 def degree @degree end |
#key ⇒ Object
:nodoc:
306 307 308 |
# File 'lib/containers/heap.rb', line 306 def key @key end |
#left ⇒ Object
:nodoc:
306 307 308 |
# File 'lib/containers/heap.rb', line 306 def left @left end |
#marked ⇒ Object
:nodoc:
306 307 308 |
# File 'lib/containers/heap.rb', line 306 def marked @marked end |
#parent ⇒ Object
:nodoc:
306 307 308 |
# File 'lib/containers/heap.rb', line 306 def parent @parent end |
#right ⇒ Object
:nodoc:
306 307 308 |
# File 'lib/containers/heap.rb', line 306 def right @right end |
#value ⇒ Object
:nodoc:
306 307 308 |
# File 'lib/containers/heap.rb', line 306 def value @value end |
Instance Method Details
#marked? ⇒ Boolean
317 318 319 |
# File 'lib/containers/heap.rb', line 317 def marked? @marked == true end |