Skip to content

Instantly share code, notes, and snippets.

@jsl
Created August 21, 2012 17:56
Show Gist options
  • Save jsl/3417875 to your computer and use it in GitHub Desktop.
Save jsl/3417875 to your computer and use it in GitHub Desktop.
class Node
attr_accessor :next, :name
end
a = Node.new
b = Node.new
c = Node.new
a.next = b
b.next = c
a.in_circular_list? # false
c.next = a
a.in_circular_list? # true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment