class DataStructures101::LinkedList::Node
Internal class to store a given value in the LinkedList
. Provides reference to next and previous node in the list @see LinkedList
@author Rene Hernandez @since 0.1
Attributes
next[RW]
prev[RW]
value[RW]
Public Class Methods
new(value, previous_node = nil, next_node = nil)
click to toggle source
# File lib/data_structures_101/linked_list.rb, line 17 def initialize(value, previous_node = nil, next_node = nil) @value = value @prev = previous_node @next = next_node end
Public Instance Methods
to_s()
click to toggle source
# File lib/data_structures_101/linked_list.rb, line 23 def to_s "<value=#{value}>" end