###
# Node List
###
class Node
attr_accessor :val, :next
def initialize(val,next=nil)
@val=val
@next=next
end
end
class List
attr_accessor :items
def initialize
@items = nil
end
def insertFirst(item)
@items = Node.new(item,@items)
end
def head
@items.val
end
def tail
@items.next
end
end