Created
February 4, 2009 16:23
-
-
Save cypok/58182 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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