Method: DLLModule::DLL#insert_head

Defined in:
lib/food/dll.rb

#insert_head(*value_array) ⇒ Object

Insert element in DLL head

Parameters:

  • *value_array (array)

    set of values



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

def insert_head (*value_array)
  value_array.each { |value|
    node = Node.new(value)
    insert_head_private(node);
  }
end