Skip to content

Instantly share code, notes, and snippets.

@wyy1234567
Created March 24, 2020 02:11
Show Gist options
  • Save wyy1234567/80992003b113905b8d861e5f81a372d3 to your computer and use it in GitHub Desktop.
Save wyy1234567/80992003b113905b8d861e5f81a372d3 to your computer and use it in GitHub Desktop.
create Node class. Each node contains a data, and a next pointer which points to the next node
class Node
attr_accessor :data, :next
def initialize(data, next_node = nil)
@data = data
@next = next_node
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment