Class: DSkipList::Node

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(k, v = nil) ⇒ Node

Returns a new instance of Node.



35
36
37
38
39
40
# File 'lib/dskiplist.rb', line 35

def initialize(k, v = nil)
  @key = k 
  @value = v.nil? ? k : v 
  @forward = []
  
end

Instance Attribute Details

#forwardObject

Returns the value of attribute forward.



33
34
35
# File 'lib/dskiplist.rb', line 33

def forward
  @forward
end

#keyObject

Returns the value of attribute key.



31
32
33
# File 'lib/dskiplist.rb', line 31

def key
  @key
end

#valueObject

Returns the value of attribute value.



32
33
34
# File 'lib/dskiplist.rb', line 32

def value
  @value
end