Skip to content

Instantly share code, notes, and snippets.

Created August 5, 2012 19:34
Show Gist options
  • Save anonymous/3266828 to your computer and use it in GitHub Desktop.
Save anonymous/3266828 to your computer and use it in GitHub Desktop.
class TreeNode
attr_accessor :nodeType, :value, :child
def initialize(nodeType, value, child=[])
@nodeType = nodeType
@value = value
@child = child
end
end
tn = TreeNode.new("Answer", "child value", nil)
tnRoot = TreeNode.new("Decision", "Root", tn)
tnRoot.child.each do |node|
puts node.child.value
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment