Class: DSA::LinkedList::DoublyNode
- Inherits:
-
Object
- Object
- DSA::LinkedList::DoublyNode
- Defined in:
- lib/dsa-ruby/linked_list.rb
Instance Attribute Summary collapse
-
#next ⇒ Object
Returns the value of attribute next.
-
#prev ⇒ Object
Returns the value of attribute prev.
-
#val ⇒ Object
Returns the value of attribute val.
Instance Method Summary collapse
-
#initialize(val = 0, nxt = nil, prev = nil) ⇒ DoublyNode
constructor
A new instance of DoublyNode.
Constructor Details
#initialize(val = 0, nxt = nil, prev = nil) ⇒ DoublyNode
Returns a new instance of DoublyNode.
15 16 17 18 19 |
# File 'lib/dsa-ruby/linked_list.rb', line 15 def initialize(val = 0, nxt = nil, prev = nil) @val = val @next = nxt @prev = prev end |
Instance Attribute Details
#next ⇒ Object
Returns the value of attribute next.
13 14 15 |
# File 'lib/dsa-ruby/linked_list.rb', line 13 def next @next end |
#prev ⇒ Object
Returns the value of attribute prev.
13 14 15 |
# File 'lib/dsa-ruby/linked_list.rb', line 13 def prev @prev end |
#val ⇒ Object
Returns the value of attribute val.
13 14 15 |
# File 'lib/dsa-ruby/linked_list.rb', line 13 def val @val end |