Class: LinkedList::DoublyNode
- Inherits:
-
Object
- Object
- LinkedList::DoublyNode
- Defined in:
- lib/data_struct/linked_list.rb
Overview
This node for Doubly Linked list implementation.
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#next_val ⇒ Object
Returns the value of attribute next_val.
-
#pre_val ⇒ Object
Returns the value of attribute pre_val.
Instance Method Summary collapse
-
#initialize(data, pre_val = nil, next_val = nil) ⇒ DoublyNode
constructor
A new instance of DoublyNode.
Constructor Details
#initialize(data, pre_val = nil, next_val = nil) ⇒ DoublyNode
Returns a new instance of DoublyNode.
18 19 20 21 22 |
# File 'lib/data_struct/linked_list.rb', line 18 def initialize(data, pre_val = nil, next_val = nil) @data = data @next_val = next_val @pre_val = pre_val end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
17 18 19 |
# File 'lib/data_struct/linked_list.rb', line 17 def data @data end |
#next_val ⇒ Object
Returns the value of attribute next_val.
17 18 19 |
# File 'lib/data_struct/linked_list.rb', line 17 def next_val @next_val end |
#pre_val ⇒ Object
Returns the value of attribute pre_val.
17 18 19 |
# File 'lib/data_struct/linked_list.rb', line 17 def pre_val @pre_val end |