Class: FibonacciHeap::CircularDoublyLinkedList::Sentinel

Inherits:
Object
  • Object
show all
Defined in:
lib/fibonacci_heap/circular_doubly_linked_list.rb

Overview

A Sentinel node to simplify boundary conditions in the linked list.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSentinel

Returns a new instance of Sentinel.



13
14
15
16
# File 'lib/fibonacci_heap/circular_doubly_linked_list.rb', line 13

def initialize
  @next = self
  @prev = self
end

Instance Attribute Details

#nextObject

Returns the value of attribute next.



11
12
13
# File 'lib/fibonacci_heap/circular_doubly_linked_list.rb', line 11

def next
  @next
end

#prevObject

Returns the value of attribute prev.



11
12
13
# File 'lib/fibonacci_heap/circular_doubly_linked_list.rb', line 11

def prev
  @prev
end