Skip to content

Instantly share code, notes, and snippets.

@armandocanals
Created June 8, 2012 04:11
Show Gist options
  • Save armandocanals/2893521 to your computer and use it in GitHub Desktop.
Save armandocanals/2893521 to your computer and use it in GitHub Desktop.
Linked list
class Node
attr_accessor :next, :data
def push(str)
new_node= Node.new
new_node.data = str
node = self
while node.next
node = node.next
end
node.next = new_node
end
end
@ggilder
Copy link

ggilder commented Jun 8, 2012

@armandocanals
Copy link
Author

fixed :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment