Skip to content

Instantly share code, notes, and snippets.

@cypok
Created February 4, 2009 16:23
Show Gist options
  • Save cypok/58182 to your computer and use it in GitHub Desktop.
Save cypok/58182 to your computer and use it in GitHub Desktop.
class ListNode
attr_accessor :prev, :next, :value
def initialize(prev, next, value)
@prev = prev
@next = next
@value = value
end
end
class List
attr_accessor :tail, :head
def initialize(value)
node = ListNode.new nil, nil, value
@head = node
@tail = node
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment